Hi there i'm trying to check if a string match one of the fields in a certain column in a table for this i need to get all the rows from result object i'm using php 5.2.x so can't use fetch_row_all method instead i'm tring to build a new array that will hold all rows here is my code:
$sql = new mysqli($config['host'],$config['user'],$config['pass'],$config['db_name']);
if (mysqli_connect_errno())
{
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT domain FROM services";
$result = $sql->query($query);
while($row = $result->fetch_row());
{
$rows[]=$row;
}
$result->close();
$sql->close();
return $rows;
$rows suppose to be the new array that contain all rows but instead i get an empty array any ideas why this is happening?