RE: [PHP] multiple queries & mysql_query()
| From: | Ford, Mike [LSS] | Date: | Fri, 23 May 2003 09:19:00 +0000 |
| Subject: | RE: [PHP] multiple queries & mysql_query() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-148746@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Wee Keat [mailto:weekeat@visualdensity.com]
> Sent: 23 May 2003 03:07
>
> I'm using a rather rediculous piece of code that doesnt work:
>
> $CatId = 2;
> $query = "DELETE FROM ProdCat WHERE CatId=$CatId;DELETE FROM
> ProdList WHERE CatId=$CatId;DELETE FROM Slideshow WHERE CatId=$CatId";
> $result = mysql_query($query);
>
> When run with mysql_error(), i get syntax errors with the
> $query contents.
>
> Anyone know what im doing wrong
Trying to do 3 SQL statements in one query.
> or can suggest a better
> method of doing 3 delete statements at once?
There isn't a better method because you can't do that at all from PHP.
You will need to do three separate queries with one delete in each.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211