Re: insert array values
| From: | PJ | Date: | Sat, 07 Mar 2009 00:44:14 +0000 |
| Subject: | Re: insert array values | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-289515@lists.php.net to get a copy of this message | ||
9el wrote:
>
> On Sat, Mar 7, 2009 at 5:37 AM, PJ <af.gourmet@videotron.ca
> <mailto:af.gourmet@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_categories ( book_id, category )
> VALUES( '$autoID', '$categoriesID[0]' ),
> ( '$autoID', '$categoriesID[1]' ),
> ( '$autoID', '$categoriesID[2]' ),
> ( '$autoID', '$categoriesID[3]' )
> ( '$autoID', '$categoriesID[4]' )";
>
> Does it make sense?
> How do I pass the values to the query?
>
>
>
> You can run a php loop inside the insert clause.
> But if its already existing record then it woud be UPDATE clause.
>
Could I have a small hint as to how to do that. I'll check the manual
and search G in the meantime. Right now, it's Friday night and I'm
about to get whammied by the wife... ;-) have a good night & let's
hope for a brighter tomorrow, tomorrow, tomorrowwww
--
unheralded genius: "A clean desk is the sign of a dull mind. "
-------------------------------------------------------------
Phil Jourdan --- pj@ptahhotep.com
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php