Mysql error echoing the variable -
i have mysql query below -
$id_order_last="15"; $id_order[]=array(); $sql1="select * `ps_orders` `id_order`> $id_order_last order `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 can see have $id_order_last
set 15 displaying value 15 when echoed. check sql echoed , display
select * `ps_orders` `id_order`> 15 order `id_order`
so in sql, run in phpmyadmin , tuples returns correct value. show result means 17 , 18 in database. means query correct!
then echoed 2 , 3 cnt++ value while $row['$id_order']
still empty <br />
shown space.
though tried loop print whole things 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]; }
use echo $row['id_order'] in place of echo $row['$id_order'] remove $.
Comments
Post a Comment