Is there a way to output an sqlite table to a php array?
I am currently trying to use a while loop but it does not display correctly.
$db = sqlite_open ("products.db", 0666, $error);
$result=sqlite_query($db,"SELECT * from Books");
$products = array();
while($row=sqlite_fetch_array($result,SQLITE_ASSOC))
{
$products = $row;
}
I want this to store into a 2D php array as if it were:
$products = array(
1 => array(
'name' => '',
'price' => ,
'category' => '',
'description' => ''
),
2 => array(
'name' => '',
'price' => ,
'category' => '',
'description' => ''
),
3 => array(
'name' => '',
'price' => ,
'category' => '',
'description' => ''
)
);
$products[$row['id']]etc.