[PHP-DB] query help

2010-11-17 Thread Vinay Kannan
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 perfor

Re: [PHP-DB] query help

2010-11-17 Thread Artur Ejsmont
well i guess you could do that. but it gets complicated after a while and there will be a lot of work and probably after a while you will get into some problems. You have to handle escaping, special types etc. Then what about performance? how to query the data ... using similar approach or is

Re: [PHP-DB] query help

2010-11-17 Thread Bastien Koert
On Wed, Nov 17, 2010 at 8:51 AM, Vinay Kannan wrote: > 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 co

Re: [PHP-DB] query help

2010-11-17 Thread Max E.K
From: "Vinay Kannan" To: "PHP DB" , "php mysql" 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 arra

Re: [PHP-DB] query help

2010-11-17 Thread Niel Archer
> 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 functi

RE: [PHP-DB] query help

2010-11-17 Thread Constantin Brinzoi
Hey, You can also try PEAR module MDB2 to insert an array into a table. The function is: "executeMultiple". This works for other SQL queries too. Check this link please: http://pear.php.net/manual/en/package.database.mdb2.intro-execute.php Cheers, -Original Message- From: Artur Ejsmon

RE: [PHP-DB] query help

2010-11-17 Thread Ashay Chaudhary
The most performant methods are to use well parameterized stored procedure or a prepared parameterized statement. : Ashay -Original Message- From: Niel Archer [mailto:n...@chance.now] Sent: Wednesday, November 17, 2010 6:30 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] query help >