SQLi Prepared Statement Failing

None of my prepared statements are working, including this one:
$sql = “SELECT ****, **** FROM **** ORDER BY **** DESC;”;
$stmt = mysqli_stmt_init($conn);
if (!mysqli_stmt_prepare($stmt, $sql)) {
header(“location: …/index.php?error=stmtfailed”);


Every time, !mysqli_stmt_prepare($stmt, $sql) = true. There is no problem with the database connection.

What is going on?

It should say MySQLi

Also, the same code works on a local server

Whats the error? Can you share a screenshot?

I just found out what I did wrong. The table name had a capital.

Oh, ok!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.