Forum Moderators: coopster

Message Too Old, No Replies

Import array into correct columns in a table

How can I verify the column exists?

         

Clay213

10:15 pm on Aug 6, 2009 (gmt 0)

10+ Year Member



I have a $array containing records I need to insert into table $leads

I want to make sure that each value is placed in the appropriate column-- even if the array is out of order.

How can I write a loop which parses the array and places the values in the proper column?

eelixduppy

12:43 am on Aug 7, 2009 (gmt 0)



Is it an associative array, otherwise you won't be able to.

If you want to know if a specific one exists, you can use array-key-exists [us.php.net]...


if(array_key_exists('col_name', $array))
{
// insert
}