0

I am having this 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 ''3'' at line 1

The $get1 value is 3. I tried enough but to no avail. I don't see any problem on my code.. :(

//EXCRACT THE IDs
$result = mysql_query("SELECT id FROM agents WHERE lft BETWEEN '$lft' and '$rgt' and autoshipdate BETWEEN '$unistart' and '$uniend' ORDER BY id desc LIMIT 0,'$get1'")or die(mysql_error());
$output = array();
while ($row = mysql_fetch_array($result)) {
  $output[] = "id = '".$row['id']."' ";
}
$gen1 = implode(' or ', $output);
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by codewalkz
0

Hi

Try using brackets..and remove the quotes near $get1

$result = mysql_query("SELECT id FROM agents WHERE (lft BETWEEN '$lft' and '$rgt') AND (autoshipdate BETWEEN '$unistart' and '$uniend') ORDER BY id desc LIMIT 0,$get1") or die(mysql_error());

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.