How can you update a record with a prepared statement?
Posted: Fri Dec 26, 2008 9:24 am
I've looked at the PHP.net manual, searched Google and I can't find any examples of updating records with prepared statements. Everything is on select and insert...
How is it done?
I tried the following, but it says I have a syntax error from the first line of code...
Does anyone have any examples of using UPDATE with prepared statements?
How is it done?
I tried the following, but it says I have a syntax error from the first line of code...
Code: Select all
$q = "UPDATE table1 SET title=?, description=?, price=?, location=?, email=?, date=? WHERE id=$id";
$stmt = mysqli_prepare($dbc, $q);
mysqli_stmt_bind_param($stmt, 'ssisss', $title, $descrip, $pri, $loc, $e, $date1);
mysqli_stmt_execute($stmt);