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 code below worked on my old iMac with MAMP. However, it does not work on my new iMac. How do I fix this? Do I need to do something to the php.ini file?

<?php
$dbConnection = mysqli_connect("localhost", "xxxx", "xxxx", "gallery");
$query = "SELECT * FROM images";
$stmt = mysqli_prepare($dbConnection,$query);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $id, $categories,$img_name);
   while (mysqli_stmt_fetch($stmt)) {
     echo $id."<br />";

 }

?>
See Question&Answers more detail:os

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

1 Answer

You should enable php_mysqli extension in PHP.ini. It's disabled by default.

look for the following line: extension=php_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
...