Welcome Guest, Not a member yet? Register   Sign In
Mysql insert not working properly
#6

[eluser]ppwalks[/eluser]
Think may have found an easier way to get the values into db, but stumbled across another problem, I have used the batch_update method to insert the arrays but I cannot think of a way to add an identifier to the table. here is the bit of code:

Code:
$data = array(
    $product, $cat_id
  );
      $this->db->insert_batch('product_category', $data);
And this produces:

Unknown column '0' in 'field list'

INSERT INTO `product_category` (`0`, `1`, `2`) VALUES ('297','297','297'), ('1','4','6')

So how can I change the table selection, this is seriously driving me mad now!

thanks in advance....


Messages In This Thread
Mysql insert not working properly - by El Forum - 08-08-2012, 11:46 AM
Mysql insert not working properly - by El Forum - 08-08-2012, 12:24 PM
Mysql insert not working properly - by El Forum - 08-09-2012, 05:10 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 06:27 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 07:18 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 08:24 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 08:45 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 08:48 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 08:52 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 08:54 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 09:14 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 09:22 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 09:23 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 09:26 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 09:30 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 09:31 AM
Mysql insert not working properly - by El Forum - 08-09-2012, 09:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB