Re: foreach problem
| From: | Jason Wong | Date: | Fri, 07 Feb 2003 19:33:30 +0000 |
| Subject: | Re: foreach problem | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-25510@lists.php.net to get a copy of this message | ||
On Friday 07 February 2003 11:22, Sam Folk-Williams wrote:
> Hi,
>
> I can't figure out why this won't work:
>
> foreach($event_date as $val) {
>
> $sql2 = "INSERT INTO cal_date_map (entry_id, date) VALUES (\"$entry_id\",
> \"$val\")";
> $result = @mysql_query($sql2,$connection) or die
> ("Problem executing foreach database query.");
> }
>
> $event_date is an array with several dates separated by commas.
> (2003-10-02, 2003-10-03). The code above successfuly inserts the first dae
> in the array, but none of the others... am I missing something?
Any error messages? If so what does mysql_error() say?
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
------------------------------------------
/*
WHERE CAN THE MATTER BE
Oh, dear, where can the matter be
When it's converted to energy?
There is a slight loss of parity.
Johnny's so long at the fair.
*/