php mysqli prepared statement
Hey, I have a quick one. Is there any way to include a variable into a prepared query? example: $sql = "SELECT id, title, author, LEFT(description, 40) AS excerpt, image_small, image_med, date FROM posts ORDER BY id DESC LIMIT $start, $postsPerPage"; $result = $connect->prepare($sql) or die ('error'); $result->execute(); $result->bind_result($id, $title, $author, $excerpt, $image_small, $image_med, $date); Thanks! you want the following: $start = 1; $postsPerPage = 1; $sql = "SELECT id, title, author, LEFT(description, 40) AS excerpt, image_small, image_med, date FROM posts ORDER BY id DESC