I need to run 2 queries in one session
Something like:
$query1="SELECT * FROM products WHERE product_id = $myid";
Output of $query1
$query2="SELECT * FROM products WHERE $item_number = item_sub";
Output of $query2
How can I achieve that?
The same way you do one query...
$query1 = "..."; $result = mysql_query($query1); while (...) { // output result }
$query2 = " ... "; $result = mysql_query($query2); while (...) { // output result }
Diego
It is also a good idea to free your result set between the queries.
mysql_free_result($result);