Tag Archives: PHP+MYSQL

Mysqli::stmt Fatal error: Call to a member function bind_param() on a non-object in …

$name = “Ming”;
$sex = “male”;
$age=20;
$sql=”insert into student(name,sex,age) values (?,?,?,?) “;
$mysqli_stmt=$mysqli-> prepare($sql);
$mysqli_stmt-> bind_param(‘ssi’, $name,$sex,$age);No syntax error is indicated, but data insertion is always unsuccessful. On checking, $SQL =”insert into Student (name,sex,age) values (?,?,?,?) “; One too many?, there is no corresponding parameter.

Fatal error: Uncaught Error: Call to undefined function mysql_connect()

If this problem occurs, you can follow the following steps.
1. First of all, you should make sure that you are using the version of PHP. If it’s version 7.x, you should use mysqli_connect(), since mysqli_connect() has been dropped in version 7.x, or you can use PDO instead. The 5.x version of mysql_connect() and mysqli_connect() are both available.
2. If you don’t succeed in the first step, you can do the following:
Mysql> create extension=php_mysqli. DLL with extension=php_mysqli. DLL with extension=php_mysqli. DLL with extension=php_mysqli. DLL with extension=php_mysqli. DLL; ‘removed. Php_mysqli. DLL =php_mysqli. DLL = ‘; ‘and you find that there is no extension=php_mysql. DLL because it has been deprecated.)
(2) Then look for extension_dir = “ext”. ‘Remove it. 5.x is the same as 7.x.
(3) Then restart Apache.