Re: Working query not able to run with PHP script.
| From: | CPT John W. Holmes | Date: | Fri, 19 Sep 2003 14:41:10 +0000 |
| Subject: | Re: Working query not able to run with PHP script. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-30579@lists.php.net to get a copy of this message | ||
From: "Jonathan Villa" <jvilla@isdesigndev.com>
> I have several tables I want to delete as well as their reference in
> another database
>
> The query produced is this:
>
===========================================================================
> DROP TABLE xxx.zorder_47629403705b7e7f0c97387559d8c811; DELETE FROM
> orders WHERE table_name = "zorder_47629403705b7e7f0c97387559d8c811";
[snip]
> //$sql .= ' DROP TABLE xxx.'.$rows['table_name'].';DELETE FROM orders
> WHERE table_name = "'.$rows['table_name'].'";';
> }
> $dbConn = mysql_connect("localhost", "root", "new-password");
> mysql_select_db("xxx", $dbConn);
> mysql_query($sql, $dbConn);
You can only do one query per mysql_query() call. You'll need to loop and
call each query individually.
---John Holmes...