Click to See Complete Forum and Search --> : PHP & Mysql
Jonathan
12-07-2003, 04:25 PM
I am wonderin if this is the correct syntax to select the most current data within the database... here:
mysql_query("select * from database order by date desc limit 0, 15");
Kyleva2204
12-07-2003, 08:23 PM
err close :) try this:
$sql = "select * from database order by date desc limit 0, 15";
mysql_query($sql, $connect) or die(mysql_error());
Now I'm not sure but I always define $connect with the mysql_connect function like this:
$connect = mysql_connect(me, pass, localhost);
but u almost had it.
Originally posted by Jonathan
I am wonderin if this is the correct syntax to select the most current data within the database... here:
mysql_query("select * from database order by date desc limit 0, 15");
Jonathan
12-07-2003, 10:08 PM
Isn't the exact same thing? :)
I didn't include the mysql connection. I was just wonderin if that was how you grab something (the last 15 in decending order)
I use the persistant connection
mysql_pconnect("localhost","username","password")
I was raised to use that :)
Kyleva2204
12-08-2003, 06:22 AM
O hmmm pconnect cool. I'm a starter at PHP and I always used connect. wow thanks turns out u tought me sumtin :rolleyes:. Anyway this is just a snipplet of it:
SELECT *
FROM `comments`
WHERE 1
ORDER BY `Name` DESC LIMIT 0 , 30
^ correct
Originally posted by Jonathan
Isn't the exact same thing? :)
I didn't include the mysql connection. I was just wonderin if that was how you grab something (the last 15 in decending order)
I use the persistant connection
mysql_pconnect("localhost","username","password")
I was raised to use that :)