So I've been trying various other threads, but none seem to use MySQLI, nor work. I'm attempting to query a MySQL table via MySQLI, the convert the returned column into an array to be used later. Here's what I have so far.
$sql = new mysqli("URL", "user", "pass","db") or die ("Not connected");
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit;
}
$sql_query = "SELECT Desired_column FROM Table_Name";
$result_array = $sql->query($sql_query);
while($row = $result_array->fetch_row()) {
$rows[]=$row;
}
$result_array->close();
$sql->close();
return $rows;
And yes... I'm a complete novice at coding so PHP vets, enjoy seeing how far you've come!
The error I am getting is
Call to a member function fetch_row() on Boolean on line 60