K
K
Kifw2017-05-31 20:22:03
local server
Kifw, 2017-05-31 20:22:03

Why does it show an error on the hosting if everything is fine on the local server?

On the local server - OpenServer everything works fine. Today I posted the site for hosting, it shows an error:
Fatal error: Call to undefined function mysqli_fetch_all() in /home/virtwww/.../http/core/models/news.php on line 16
And commented on the function on this line, the error showed elsewhere with the same function.
I don't know if it will help, but here is the code

function getNewsMain(){
    $sql = "SELECT * FROM news ORDER BY rating DESC LIMIT 5";
    // return mysqli_fetch_all(selectData($sql), MYSQLI_ASSOC);
  }

Hosting 1gb.ru.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
ThunderCat, 2017-05-31
@ThunderCat

phpinfo(); We look at which modules are enabled, especially pay attention to the modules that are disabled, in particular - go to the hosting control panel and enable mysqli (mysqlnd) in the php settings. Also see the current PHP version, on older ones use fetch_assoc();

L
link_irk, 2017-06-01
@link_irk

Use PDO to work with databases

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question