PHP / MySQLi - Cycle Failure

Here is my code:

$v = $conn->query("SELECT * FROM `categories` WHERE `Link`!=''"); while($vrowi = mysql_fetch_array($v, MYSQLI_ASSOC)) { $url = $vrowi['Link']; $Cat = $vrowi['id']; } 

while does not work. Could you tell me where the error is? Thanks in advance!

-1
source share
1 answer

You mix MySQLi object-oriented code with a functional approach and must choose one or the other. In your exact solution, this is:

 $v = $conn->query("SELECT * FROM `categories` WHERE `Link` != '';"); while ($vrowi = $v->fetch_assoc()) { $url = $vrowi['Link']; $Cat = $vrowi['id']; } 
0
source

Source: https://habr.com/ru/post/1238765/


All Articles