Hello, I am doing a query with PHP and I am connecting to the normal database, but when I return the query and mount in the table it is returning the error: Warning: mysqli_fetch_array () expects parameter 1 to be mysqli_result, object given in in line 273 of my code.
On line 273 I have a While I'm fetching the array with the values and saving in a variable to arrange in my table afterwards. Follow line 273:
while ($result = mysqli_fetch_array($link, $query)) {
Here's how the connection is being made:
define("HOST","hostmysql");
define("USER","usuario");
define("PASSWORD","senha");
define("DBNAME","nomeDB");
$link = mysqli_connect(HOST,USER,PASSWORD) or die("Erro ao conectar ao banco de dados");
Here is the MySQL search I'm doing together with While again:
'$query = "SELECT id, tipo, numero, ano, descricao, data, horario, arquivos, cadastro, status FROM lici ORDER BY id DESC";
while ($result = mysqli_fetch_array($link, $query)) {'
I hope this helps to help me.
Thank you!