Re: [PHP] insert array values

2009-03-08 Thread PJ
Ashley Sheridan wrote: > On Sun, 2009-03-08 at 17:52 -0500, PJ wrote: > >> Ashley Sheridan wrote: >> >>> On Sun, 2009-03-08 at 16:52 -0500, PJ wrote: >>> >>> Well, I have everything more or less under control... just one little thingie... I was able to get everythin

Re: [PHP] insert array values

2009-03-08 Thread Ashley Sheridan
On Sun, 2009-03-08 at 17:52 -0500, PJ wrote: > Ashley Sheridan wrote: > > On Sun, 2009-03-08 at 16:52 -0500, PJ wrote: > > > >> Well, I have everything more or less under control... just one little > >> thingie... > >> I was able to get everything working quite well... basically as I > >> though

Re: [PHP] insert array values

2009-03-08 Thread PJ
Ashley Sheridan wrote: > On Sun, 2009-03-08 at 16:52 -0500, PJ wrote: > >> Well, I have everything more or less under control... just one little >> thingie... >> I was able to get everything working quite well... basically as I >> thought it should go with a little help from my friends, here on

Re: [PHP] insert array values

2009-03-08 Thread Ashley Sheridan
On Sun, 2009-03-08 at 16:52 -0500, PJ wrote: > Well, I have everything more or less under control... just one little > thingie... > I was able to get everything working quite well... basically as I > thought it should go with a little help from my friends, here on the > list :-) many of my proble

Re: [PHP] insert array values

2009-03-08 Thread PJ
Well, I have everything more or less under control... just one little thingie... I was able to get everything working quite well... basically as I thought it should go with a little help from my friends, here on the list :-) many of my problems were small omissions and /or typos and misplaced bra

Re: [PHP] insert array values

2009-03-08 Thread Jim Lucas
PJ wrote: Jim Lucas wrote: PJ wrote: 9el wrote: On Sat, Mar 7, 2009 at 5:37 AM, PJ mailto:af.gour...@videotron.ca>> wrote: I've done some rethingking and this may be the direction to go: What I need to wind up with is something like this: $sql = "INSERT INTO book_categor

Re: [PHP] insert array values

2009-03-07 Thread PJ
Jim Lucas wrote: > PJ wrote: >> 9el wrote: >>> On Sat, Mar 7, 2009 at 5:37 AM, PJ >> > wrote: >>> >>> I've done some rethingking and this may be the direction to go: >>> >>> What I need to wind up with is something like this: >>> >>> $sql = "INSERT INTO book_categori

Re: [PHP] insert array values

2009-03-07 Thread PJ
Jim Lucas wrote: > PJ wrote: > >> 9el wrote: >> >>> On Sat, Mar 7, 2009 at 5:37 AM, PJ >> > wrote: >>> >>> I've done some rethingking and this may be the direction to go: >>> >>> What I need to wind up with is something like this: >>> >>> $sql = "

Re: [PHP] insert array values

2009-03-06 Thread Jim Lucas
PJ wrote: > 9el wrote: >> On Sat, Mar 7, 2009 at 5:37 AM, PJ > > wrote: >> >> I've done some rethingking and this may be the direction to go: >> >> What I need to wind up with is something like this: >> >> $sql = "INSERT INTO book_categories ( book_id, ca

Re: [PHP] insert array values

2009-03-06 Thread PJ
9el wrote: > > On Sat, Mar 7, 2009 at 5:37 AM, PJ > wrote: > > I've done some rethingking and this may be the direction to go: > > What I need to wind up with is something like this: > > $sql = "INSERT INTO book_categories ( book_id, category ) >

Re: [PHP] insert array values

2009-03-06 Thread 9el
On Sat, Mar 7, 2009 at 5:37 AM, PJ wrote: > I've done some rethingking and this may be the direction to go: > > What I need to wind up with is something like this: > > $sql = "INSERT INTO book_categories ( book_id, category ) > VALUES( '$autoID', '$categoriesID[0]' ), >( '$autoID', '$cate

Re: [PHP] insert array values

2009-03-06 Thread PJ
I've done some rethingking and this may be the direction to go: What I need to wind up with is something like this: $sql = "INSERT INTO book_categories ( book_id, category ) VALUES( '$autoID', '$categoriesID[0]' ), ( '$autoID', '$categoriesID[1]' ), ( '$autoID', '$categoriesID[2]'

Re: [PHP] insert array values

2009-03-06 Thread PJ
haliphax wrote: > On Fri, Mar 6, 2009 at 4:07 PM, PJ wrote: > >> haliphax wrote: >> >>> On Fri, Mar 6, 2009 at 3:00 PM, PJ wrote: >>> I've been racking my little peanut-brain as well as big Google with little hope... I can retrieve the array from the multiple select

Re: [PHP] insert array values

2009-03-06 Thread PJ
haliphax wrote: > On Fri, Mar 6, 2009 at 4:07 PM, PJ wrote: >> haliphax wrote: >>> On Fri, Mar 6, 2009 at 3:00 PM, PJ wrote: I've been racking my little peanut-brain as well as big Google with little hope... I can retrieve the array from the multiple select dropdown box but I

Re: [PHP] insert array values

2009-03-06 Thread haliphax
On Fri, Mar 6, 2009 at 4:07 PM, PJ wrote: > haliphax wrote: >> On Fri, Mar 6, 2009 at 3:00 PM, PJ wrote: >>> I've been racking my little peanut-brain as well as big Google with >>> little hope... >>> I can retrieve the array from the multiple select dropdown box but I >>> can't quite manage to in

Re: [PHP] insert array values

2009-03-06 Thread PJ
haliphax wrote: > On Fri, Mar 6, 2009 at 3:00 PM, PJ wrote: >> I've been racking my little peanut-brain as well as big Google with >> little hope... >> I can retrieve the array from the multiple select dropdown box but I >> can't quite manage to insert the data which is just id numbers for a >> ta

Re: [PHP] insert array values

2009-03-06 Thread PJ
Bastien Koert wrote: > On Fri, Mar 6, 2009 at 4:00 PM, PJ wrote: > > >> I've been racking my little peanut-brain as well as big Google with >> little hope... >> I can retrieve the array from the multiple select dropdown box but I >> can't quite manage to insert the data which is just id numbers

Re: [PHP] insert array values

2009-03-06 Thread haliphax
On Fri, Mar 6, 2009 at 3:00 PM, PJ wrote: > I've been racking my little peanut-brain as well as big Google with > little hope... > I can retrieve the array from the multiple select dropdown box but I > can't quite manage to insert the data which is just id numbers for a table. > I've tried some wh

Re: [PHP] insert array values

2009-03-06 Thread Bastien Koert
On Fri, Mar 6, 2009 at 4:00 PM, PJ wrote: > I've been racking my little peanut-brain as well as big Google with > little hope... > I can retrieve the array from the multiple select dropdown box but I > can't quite manage to insert the data which is just id numbers for a table. > I've tried some w

Re: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Richard Lynch
On Wed, May 2, 2007 10:42 am, Rahul S. Johari wrote: > Here¹s the thing, I¹ve got an Array which has it¹s own set of Keys => > Values. I¹m using foreach() to read the Keys => Values like this: > //note added arguments! > function pr1($var, $var2, $var3) { > foreach ($var as $k => $

RE: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Richard Lynch
On Wed, May 2, 2007 11:03 am, Jim Moseby wrote: >> >> $sql = "INSERT INTO table (f1, f2, f3, ". implode(",", >> array_keys($pr1)) .") >>VALUES ('abc', '123', '456', ". implode(",", >> array_values($pr1)) >> .")"; >> >> HTH, >> >> Brad > > > Might not work if the array values need to be en

Re: [PHP] INSERT Array Values into mySQL Table - SOLVED!

2007-05-02 Thread Rahul Sitaram Johari
WORKS Like A Charm!! :) Thanks. On 5/2/07 12:14 PM, "Brad Fuller" <[EMAIL PROTECTED]> wrote: > Jim Moseby wrote: >>> $sql = "INSERT INTO table (f1, f2, f3, ". implode(",", >>> array_keys($pr1)) .") VALUES ('abc', '123', '456', ". implode(",", >>> array_values($pr1)) >>> .")"; >>> >>> HTH, >>

RE: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Brad Fuller
Jim Moseby wrote: >> $sql = "INSERT INTO table (f1, f2, f3, ". implode(",", >>array_keys($pr1)) .") VALUES ('abc', '123', '456', ". implode(",", >> array_values($pr1)) >> .")"; >> >> HTH, >> >> Brad > > > Might not work if the array values need to be enclosed in > quotes. I would build

Re: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Rahul Sitaram Johari
Ave, I was just about to post when I saw your message. I think what you're saying is exactly what is happening. The values have Spaces and stuff so Quotes are Required - cannot have values not enclosed in Quotes. Other then that it was actually working. Is there a way to enclose in Quotes using

RE: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Jim Moseby
> > $sql = "INSERT INTO table (f1, f2, f3, ". implode(",", > array_keys($pr1)) .") > VALUES ('abc', '123', '456', ". implode(",", > array_values($pr1)) > .")"; > > HTH, > > Brad Might not work if the array values need to be enclosed in quotes. I would build the query string in a for

Re: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread David Giragosian
On 5/2/07, Rahul S. Johari <[EMAIL PROTECTED]> wrote: Ave, Here¹s the thing, I¹ve got an Array which has it¹s own set of Keys => Values. I¹m using foreach() to read the Keys => Values like this: function pr1($var) { foreach ($var as $k => $v) { echo ³$k => $v²;

RE: [PHP] INSERT Array Values into mySQL Table

2007-05-02 Thread Brad Fuller
Rahul S. Johari wrote: > Ave, > > Here¹s the thing, I¹ve got an Array which has it¹s own set of > Keys => Values. I¹m using foreach() to read the Keys => Values like > this: > > function pr1($var) { > foreach ($var as $k => $v) { > echo ³$k => $v²; > } >