Welcome Guest, Not a member yet? Register   Sign In
Multiple row inserts on db query
#1

[eluser]newbie_codeigniter[/eluser]
Need a little bit of help with transferring php code into codeigniter's coding. I have a form in which an employee can select multiple fields but i need to translate my regular php code into codeigniter's coding and am having a little bit of difficulty figuring it out. Any help would be greatly appreciated thanks. here is the code
Code:
$limit = count($Product);
for($i=0;$i<$limit;$i++) {
$sale_id[$i] = mysql_real_escape_string($sale_id[$i]);
$customer_address[$i] = mysql_real_escape_string($customer_address[$i]);
$customer_borough[$i] = mysql_real_escape_string($customer_borough[$i]);
$delivered[$i] = mysql_real_escape_string($delivered[$i]);
$customer_id[$i] = mysql_real_escape_string($customer_id[$i]);
$driver_id[$i] = mysql_real_escape_string($driver_id[$i]);
$order_cost[$i] = mysql_real_escape_string($order_cost[$i]);

$query = "INSERT INTO delivery_sales(sale_id, customer_address, customer_borough, delivered, customer_id, driver_id, order_cost) VALUES ('".$sale_id[$i]."','".$customer_address[$i]."','".$customer-borough[$i]."','".$delivered[$i]."','".$customer_id[$i]."','".$driver_id[$i]."','".$order_cost[$i]."')";
all of this code corresponds to my view, which has the appropriate field names and id's im just having a lot of difficulty converting this to codeigniter any help would be greatly appreciated. Thanks in advance.


Messages In This Thread
Multiple row inserts on db query - by El Forum - 02-26-2012, 02:42 AM
Multiple row inserts on db query - by El Forum - 02-26-2012, 02:49 AM
Multiple row inserts on db query - by El Forum - 02-26-2012, 03:02 AM
Multiple row inserts on db query - by El Forum - 02-26-2012, 03:06 AM
Multiple row inserts on db query - by El Forum - 02-26-2012, 03:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB