corillo181 Posted May 6, 2006 Share Posted May 6, 2006 shouldn't this display pictures by date[code]<?php $query=mysql_query("SELECT * FROM pictures ORDER BY datetime") or die(mysql_error()); $result = mysql_num_rows($query); while($pic=mysql_fetch_array($result)){ echo '<a href=clubsparty/pictures.php'.$pic['name'].'>'.'<img border=0 height=150 width=110 src="clubsparty/3-11-06/'.$pic['name'].'"></a>';} ?>[/code] Link to comment https://forums.phpfreaks.com/topic/9166-order-by-date/ Share on other sites More sharing options...
redarrow Posted May 6, 2006 Share Posted May 6, 2006 <?php $query=mysql_query"SELECT * FROM pictures limit 1" or die("mysql errow"); $result = mysql_num_rows($query);while($pic=mysql_fetch_array($result)){echo '<a href=clubsparty/pictures.php'.$pic['name'].'>'.'<img border=0 height=150 width=110 src="clubsparty/3-11-06/'.$pic['name'].'"></a>';} ?> Link to comment https://forums.phpfreaks.com/topic/9166-order-by-date/#findComment-33772 Share on other sites More sharing options...
corillo181 Posted May 6, 2006 Author Share Posted May 6, 2006 mm ok makin that in to a variable how is that going to help? Link to comment https://forums.phpfreaks.com/topic/9166-order-by-date/#findComment-33773 Share on other sites More sharing options...
corillo181 Posted May 6, 2006 Author Share Posted May 6, 2006 also i notice that if i keep it like that everytime i upload a pic is going to display it..all i want to do is display a single picture.. the last one uploaded.. Link to comment https://forums.phpfreaks.com/topic/9166-order-by-date/#findComment-33775 Share on other sites More sharing options...
corillo181 Posted May 6, 2006 Author Share Posted May 6, 2006 alright all had to do was limit 1 but still i can't get the last pic uploaded to show up.. Link to comment https://forums.phpfreaks.com/topic/9166-order-by-date/#findComment-33777 Share on other sites More sharing options...
corillo181 Posted May 6, 2006 Author Share Posted May 6, 2006 ahh forget the time date all i had to do was add ASC to make the last row appear.. come on ppl i keep answering my self :| Link to comment https://forums.phpfreaks.com/topic/9166-order-by-date/#findComment-33780 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.