Re: Can you l put a mysql statement in a while loop?
| From: | Jan-Eric Duden | Date: | Fri, 27 Oct 2000 06:27:27 +0000 |
| Subject: | Re: Can you l put a mysql statement in a while loop? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-22274@lists.php.net to get a copy of this message | ||
What about this here?
$statement="";
while(list($id,$v)=each($myarray))
{
$statement.="UPDATE table SET value=$v WHERE id=$id;";
}
$result=mysql_query($statement);
Eric
----- Original Message -----
From: "Shane McBride" <php@riversidedesigns.net>
To: "Php-General" <php-general@lists.php.net>
Sent: Thursday, October 26, 2000 9:19 PM
Subject: [PHP] Can you l put a mysql statement in a while loop?
I have an array that contains new values for a table. Can I use an "update"
statement in a while loop?
I seems like a lot of overkill and waste of resources.
Any better ideas (heck, ideas that will work would be cool).
Nothing found elsewhere...
TIA,
Shane