now i wonder why dont this work?
when ppl click on back it send the to the first id in the table..
Code: Select all
$month=$_GET['m'];
$curent_id=$_GET['p'];
$b=mysql_query("SELECT photo_id FROM tra_cotm_photo WHERE photo_id<$curent_id AND cotm_id='$month' LIMIT 1")or die(mysql_error());
$back=mysql_fetch_array($b);
echo '<a href='.$_SERVER['PHP_SELF'].'?m='.$_GET['m'].'&p='.$back['photo_id'].'>back</a>';now this next bottom does work it sends ppl to te next id..
now they exctly the same so why dont they act the same?
Code: Select all
$month=$_GET['m'];
$curent_id=$_GET['p'];
$n=mysql_query("SELECT photo_id FROM tra_cotm_photo WHERE photo_id>$curent_id AND cotm_id='$month' LIMIT 1")or die(mysql_error());
$next=mysql_fetch_array($n);
echo '<a href='.$_SERVER['PHP_SELF'].'?m='.$_GET['m'].'&p='.$next['photo_id'].'>next</a>';