Why is my PHP prepared statement for MySQL not working?

jugocas

New Member
I'm currently learning PHP and MySQL. I'm just wrote a class that handles all the MySQL traffic, but I'm encountering some errors.\[code\]function table_exists($tablename){ // check if table exists $stmt = $this->db->prepare("SHOW TABLES LIKE '?'"); $stmt->bind_param("s", $tablename); //This is line 24. $stmt->execute(); $ar = $stmt->affected_rows; $stmt->close(); if ($ar > 0){ return true; } else { return false; }}\[/code\]This is the code with the problem, and the error i'm getting is \[quote\] Generates Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]: Number of variables doesn't match number of parameters in prepared statement in C:\xampp\htdocs\mail\datahandler.php on line 24\[/quote\]Ideas?Thanks
 
Back
Top