I have a mysql code like this…
INSERT INTO `product` (`product_id`, `model`, `sku`) VALUES
(61, 'one-s 1407', ''),
(72, 'one-s 1408', ''),
(88, 'one-s 1409', ''),
(91, 'one-s 1403', ''),
(95, 'one-s 1404', '');
Now i would like to extract the product_id and create a php array like this..
$productid = array(61,72,88,91,95);
PLEASE NOTE:
The mysql code i given just for sample. But i have more than 1000 rows and 15 columns in my table.
I would be very happy if someone give me some php snippet which does this job easily. Thanks
Here’s a technic :
Try something by yourself. Use PDO extension to create your query and then use the method
fetchto get your data in the loop.