Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

The issue occurs with this code

<?php
define('DB_USER','root');
define('DB_PASSWORD','censored');
define('DB_HOST','localhost');
define('DB_NAME','censored');

$dbc = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
?>

I have installed php7.0-mysqli but I still get this error message

PHP Fatal error:  Uncaught Error: Call to undefined function mysqli() in /var/www/html/actions/create_account.php:29
Stack trace:
#0 {main}
  thrown in /var/www/html/actions/create_account.php on line 29, referer: http://localhost/register.php

Here is phpinfo() output on mysqli. enter image description here What is going wrong?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
332 views
Welcome To Ask or Share your Answers For Others

1 Answer

The error message is crystal clear: there is no such function in PHP and never has been. There is only a function called mysqli_connect() and class called mysqli. But classes are not functions and have different syntax to handle

It means that, according to the error message, somewhere in the /var/www/html/actions/create_account.php on line 29 there is an improper call to mysqli


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...