Jump to content

Query problem with LIMIT.


kernelgpf

Recommended Posts

The error: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '() LIMIT 1' at line 1"

 

The code:

mysql_query("SELECT pet_id from pets ORDER BY pet_id DESC() LIMIT 1")or die(mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/136275-query-problem-with-limit/
Share on other sites

No. I meant I know how to do basic MySQL and your answer is not the solution.

 

My entire code is this:

$IDquery=mysql_query("SELECT pet_id from pets ORDER BY pet_id DESC() LIMIT 1")or die(mysql_error());
$IDrow=mysql_fetch_array($IDquery);
$babyID2=$IDrow[pet_id];

Archived

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

×
×
  • Create New...

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.