Jump to content

Archived

This topic is now archived and is closed to further replies.

corillo181

order by date..

Recommended Posts

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]

Share this post


Link to post
Share on other sites
<?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>';
}
?>

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites
alright all had to do was limit 1 but still i can't get the last pic uploaded to show up..

Share this post


Link to post
Share on other sites
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 :|

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.