Jump to content

MYSQLI STMT Bind_Param


Recommended Posts

HI there, I am having trouble understanding how this function works and am getting the error:

 

Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]: Number of variables doesn't match number of parameters in prepared statement in file.php on line 65

-1

$thesql ="INSERT INTO `table` (`id` ,`name` ,`third`)
VALUES (NULL, '$name', '$third');";

if ($stmt = $thesql ->prepare($thesql)) {  
$stmt->bind_param("ss", $name2, $third);
$stmt->execute();       
} 

 

How does this work, do I need to have a "s" or "i" for a NULL value?

Link to comment
https://forums.phpfreaks.com/topic/161194-mysqli-stmt-bind_param/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.