I have a mysql query as below -
$id_order_last="15";
$id_order[]=array();
$sql1="SELECT * FROM `ps_orders` WHERE `id_order`>
$id_order_last order by `id_order`";
echo $sql1;
$result1= mysql_query($sql1);
$cnt=1;
while ($row = mysql_fetch_array($result1))
{
/*$id_order[$i]=$row['$id_order'];*/
echo $row['$id_order']."<br />";
$cnt++;
echo $cnt."<br />";
}
As you can see i have the $id_order_last set 15 so it displaying the value as 15 when echoed. To check sql i echoed it and it display
SELECT * FROM `ps_orders` WHERE `id_order`> 15 order by `id_order`
So i get in the sql, run in phpmyadmin and the tuples which get returns was correct value. It show the good result means 17 and 18 which were in database. Which means the query is correct!
then it echoed 2 and 3 the cnt++ value while $row['$id_order'] is still empty only <br /> is shown up as space.
THough i also tried the for loop to print the whole things but it still not showing up?
$i=1;
for($i;$i<=$cnt;$i++)
{
echo $id_order_last."<br />";
echo $id_order[$i]."<br />";
$id_order_last=$id_order[$i];
}