Home>

I want to take data from the table I write this code

$ conn= new mysqli ($ dbhost, $ dbuser, $ dbpass, $ dbname);
$ data= array ();
$ sql= "SELECT` pipelines_name`, `pipelines_id` FROM` fixhub_pipelines` WHERE 1 ";
while ($ row= mysqli_fetch_assoc ($ ta)) {
    $ data []= $ row;
}
echo json_encode ($ data);
? >

At the output I get

[]

What's wrong?

What's wrong? Between the formation of the query string and the output of the result, there should be, as it were, the execution of the query ...

Akina2021-12-10 08:35:42

look at least the comments -php.net/manual/ru/mysqli-result.fetch-array.php

splash582021-12-10 09:27:31