I tried to return MYSQLi data into an array but it doesn't get into the form I want.
$sql = <<<SQL
SELECT *
FROM pricee
ORDER BY idd ASC
SQL;
if(!$result = $db->query($sql)){
die('There was an error running the query [' . $db->error . ']');
}
while($row = $result->fetch_assoc()){
$price=$row['price'];
$tt=(array)$price;
$i=(array)$row['idd'];
$p=array_combine($i,$tt);
print_r($p);
}
This gives me $p in the following form
Array ( [1] => "0.99" ) Array ( [2] => "0.47" ) Array ( [3] => "0.49" )
But I need it in the following:
Array ( [1] => 0.99 [2] => 0.47 [3] => 0.49)
How can I convert it in that form?