Re: Working query not able to run with PHP script.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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...

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux