Re: multiple queries & mysql_query()
| From: | Timothy Hitchens | Date: | Fri, 23 May 2003 02:09:41 +0000 |
| Subject: | Re: multiple queries & mysql_query() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148680@lists.php.net to get a copy of this message | ||
Wee,
Why don't you simply make three sql strings and do the mysql_query()
call three times that way you can act on error messages as well.
Timothy Hitchens (HiTCHO)
Web Application Consulting
e-mail: tim@hitcho.com.au
"Nothing is ever accomplished by a reasonable man."
Friday, May 23, 2003, 12:06:58 PM, you wrote:
WK> Hi all,
WK> I'm using a rather rediculous piece of code that doesnt work:
WK> $CatId = 2;
WK> $query = "DELETE FROM ProdCat WHERE CatId=$CatId;DELETE FROM ProdList WHERE
WK> CatId=$CatId;DELETE FROM Slideshow WHERE CatId=$CatId";
WK> $result = mysql_query($query);
WK> When run with mysql_error(), i get syntax errors with the $query contents.
WK> Anyone know what im doing wrong or can suggest a better method of doing 3 delete statements
WK> at once?
WK> Yours,
WK> Wee Keat Chin
WK> http://www.visualdensity.com
WK> ------------------------------------------
WK> "Two things are infinite: the universe and human stupidity; and I'm not sure about
WK> the the universe." - Albert Einstein