I have a select statement where I want to get all rows from a table but seem to be having a mental blockage – this should be elementary stuff but can’t seem to get it working.
There are only two rows in the table ‘postage_price’ – and two columns : price | ref
Select statement is as follows:
$get_postage="SELECT price FROM postage_price ORDER BY ref DESC";
$get_postage_result=mysqli_query($dbc, $get_postage) or die("Could not get postage");
while($post_row=mysqli_fetch_array($dbc, $get_postage_result))
{
$post1[]=$post_row;
}
I am then trying to echo the results out:
echo $post1['0'];
echo $post1['1'];
this is not showing anything. My headache doesn’t help either.
As you see:
$post_rowin this line:= mysqli_fetch_array($dbc, $get_postage_result)is an array. You are trying to save the whole array value to another array in a block. 🙂EDIT