I keep getting the following 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 ” at line 1
For the following query:
$query = "SELECT `Gift`, `Type`
FROM `gifts`
WHERE `User`= '".mysql_real_escape_string($myuid)."'
LIMIT ".$start.", ".$end;
Here is the code I use to GET the $start and $end Variables:
$start = $_GET['start'];
if($start = "") {
$start = 0;
}
$end = $_GET['end'];
if($end = "") {
$end = 7;
}
I Found The Problem:
I tested this script in another browser, and it worked just fine. The problem is something with Internet Explorer 9. Anyone know why?
You should print the query out before it’s sent to the database:
Update
The OP provides in the comments to this answer that the start & end values aren’t appearing in the output, and the values are supplied by a GET request.
The output would give us a better idea what the issue is, but I recommend using sprintf to parameterize the query: