I have database A with field hotel,order_type and description. I want insert value to database A from array $new_array.
//array $new_array
Array
(
[0] => Array
(
[order_type] => 1
[currency] => 26
[net] =>
[rate] =>
[amount] =>
[bank_surcharge] =>
[ticket] =>
[profit] =>
[selling_price] =>
[description] => a
[hotel] => 1
[vendor] => 11
)
[1] => Array
(
[order_type] => 2
[currency] => 27
[net] =>
[rate] =>
[amount] =>
[bank_surcharge] =>
[ticket] =>
[profit] =>
[selling_price] =>
[description] => b
[hotel] => 1
[vendor] => 11
)
...
...
}
i tried this script but nothing happened :(
for($i = 0; $i < sizeof($new_array['order_type']); $i++){
mssql_query("INSERT INTO A(hotel_id, order_type, description)
VALUES('$new_array[$i]', '$new_array[$i]', '$new_array[$i]')");
}
How to do this with php? please anyone help me.