I have an SQL query that works, and inside the loop I want a call to another SQL query which I expect only one result, but I get an error.
Here is the code:
$i = 0;
$query = mysql_query("SELECT * FROM `orders` ORDER BY `ID` ASC ");
while($row = mysql_fetch_array($query))
{
$i++;
$productResult = mysql_select_db("SELECT * FROM `page` WHERE 'id'=".$i."'");
}
And here is what is want to get from this code:
<?=$productResult['title'];?>
How can I fix it? I know the problem is in this line:
mysql_select_db("SELECT * FROM `page` WHERE 'id'=".$i."'");