SQL Statement Error
Hello All,
I have the following bit of code:
if(isset($_GET['record'])){
$recordEdit = TRUE;
$sql = "SELECT * FROM headlines WHERE Index =?"
$stmt = $dblink->stmt_init();
if ($stmt->prepare($sql)){
$stmt->bind_param('i',$_GET['record']);
$stmt->bind_result($index,$date,$headline,$description,$newsType,$link);
$stmt->execute();
$stmt->fetch();
}
my code fails at the $stmt->prepare($sql) with 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 'Index =?'
How come my sql is not initializing correctly? I want to bind it to parameter $_Get['record'], which if I echo to the screen, is correct.
