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']; }
source share