Re: query help

From: Date: Wed, 17 Nov 2010 14:10:42 +0000
Subject: Re: query help
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-47491@lists.php.net to get a copy of this message
From: "Vinay Kannan" <vinykan@gmail.com> To: "PHP DB" <php-db@lists.php.net>, "php mysql" <PHP_MySQL_usergroup@yahoogroups.com> Sent: Wednesday, November 17, 2010 2:51:35 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: [PHP-DB] query help Hello PHP Gurus, I need your help on an insert query. I wanted to know if there is way to insert an array of values into a DB. An eg would explain this better : If I have 2 tables in a DB, 1) users has 3 columns 2) hobbies = 5 columns I was thinking of having a single function which will perform the insert on any insert which happens on the entire website. Eg : This function can be called with 2 parameters, the first parameter the table name, and the second parameter is an array of values which will be inserted into the table. eg : Users has these columns [1]ID [2] Name [3]Location so the function call would be something like * insert_into_tbale(users,array[user_values])* ** Does this make sense ? Is this a good method to follow ? Thanks in advance ! Vinay Kannan. Hi Vinay, You may want to try codeigniter. More info here. http://codeigniter.com/user_guide/database/active_record.html#insert with kind regards, Max. ------------------------------------------------ Max Kimambo Franz-Stenzer-Straße, 51 12679, Berlin. T: +493057706550 (new number) M: +4917649520175 ------------------------------------------------

« previous php.db (#47491) next »