corillo181 Posted January 18, 2007 Share Posted January 18, 2007 i got this query tha tit supposed to take the last id and bring out the path and display the pic..it was wokring fine until i put more than 10 id.. after the 10 id it stays in the id number 10 showing the picture the id that belong sto id number 10..[code] <?// getting last picture inserted in to the album and linking it to the album$get2=mysql_query("SELECT path FROM photo_thumbs WHERE album_id='".$al['album_id']."' ORDER BY photo_id DESC LIMIT 1")or die(mysql_error());$fet=mysql_fetch_array($get2); ?><a href="<?=$_SERVER['PHP_SELF']?>?a=<?=$al['album_id']?>"><img src="<?=$fet['path']?>"></a>[/code] Link to comment https://forums.phpfreaks.com/topic/34662-question-about-order-by/ Share on other sites More sharing options...
corillo181 Posted January 18, 2007 Author Share Posted January 18, 2007 the problem wa sin mysql.. i had the id field as a varchar so it was reading it as letters and not number si just had to change it to int Link to comment https://forums.phpfreaks.com/topic/34662-question-about-order-by/#findComment-163351 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.