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);