I have to query SQL-SERVER's Query and MYSQL's Query (That have the same result format but it's difference database) , But I want to call them in one while loop in PHP, Can I do that?
Ex.
$mssql_query = mssql_query(..mssql..);
$mysql_query = mysql_query(..mysql..);
while( $mssql_rs = mssql_fetch_assoc($mssql_query)|| $mysql_sql = mysql_fetch_assoc($mysql_query) )
{
..some action..
}
EDITED : I just have an solved answer. It's work for me Idea from @Drew while(bContinue)
this my code
$mssql_query = mssql_query(..mssql..);
$mysql_query = mysql_query(..mysql..);
$continue = true;
while( $continue ){
$ms_rs = mssql_fetch_assoc($mssql_query);
$my_rs = mysql_fetch_assoc($mysql_query);
if($ms_rs){ ..some action.. }
if($my_rs ){ ..some action.. }
$continue = $ms_rs|| $my_rs;
}
Thank you for all ideas.
||you need to check through&&.&&,||but doesn't work"while(bContinue)inside that do the queries followed by anifblock. Deal with the ending of thewhileand the maintenance of thebContinuevarmysql_queryinterface. It's awful and has been removed in PHP 7. A replacement like PDO is not hard to learn and a guide like PHP The Right Way helps explain best practices. Make sure your user parameters are properly escaped or you will end up with severe SQL injection bugs.