Hey guys!
I am not sure if the following are correct when using prepared statement? Because the word limit is in red when I do this instead of green…
$sql = "SELECT id FROM categories WHERE id= ? LIMIT = ?";
$stmt = mysqli_stmt_init($conn);
if (!mysqli_stmt_prepare($stmt, $sql)) {
echo 'SQL error';
} else {
mysqli_stmt_bind_param($stmt, "ii", $cid, $limit)
mysqli_stmt_execute($stmt);
Can I also do the following:
$limit = 1;
$sql3 = "UPDATE categories
SET last_post_date = ?, last_user_posted = ?
WHERE id = ?
LIMIT = ?
";
$stmt = mysqli_stmt_init($conn);
if (!mysqli_stmt_prepare($stmt, $sql3)) {
echo 'SQL error';
} else {
mysqli_stmt_bind_param($stmt, "ssii", $date, $creator, $cid, $limit);
mysqli_stmt_execute($stmt);