i have Multi array data like "cars name & cars modal"
Car name match with car model. both are different column in database (cars_name,cars_model). I want to store data from this array into database in their fields
Output:
Array
(
[car_name] => Array
(
[0] => Honda
[1] => Ford Mustang
[2] => Volvo
)
[car_modal] => Array
(
[0] => 2015
[1] => 2016
[2] => 2014
)
)
i want to store array values into single column in each row using "mysql". For this purpose i like query like this but it shows error.
$sql = "INSERT INTO cars_data (cars_name,cars_modal)
VALUES ($cars_name,$cars_modal)";
nothing happened. But errors show like this...
Notice: Array to string conversion in E:\xampp\htdocs\car_records\modal_data.php on line 45 Error: INSERT INTO cars_data (cars_name,cars_model)
VALUES (Array,Array)
Unknown column 'Array' in 'field list'
The question is how to fix it. Please help me