note 84885 deleted from function.mysql-query by danbrown
| From: | danbrown@php.net | Date: | Mon, 04 Aug 2008 16:48:31 +0000 |
| Subject: | note 84885 deleted from function.mysql-query by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-143143@lists.php.net to get a copy of this message | ||
Note Submitter: mario at smartdatalink dot com
----
Hi there,
I found an error using this function. Firstly, sometime, just sometimes my query is not executed
until I comment the part of "// or die ("....")".
And another issue I've found is that the link identifier sometimes causes the query not being
executed. A short example how problem shows up:
The class where I call "mysql_query" is the same, so, its supposed all queries should be
executed when they're syntactically well formed
---- Connecting to my servers and querying records
$srvA = new MysqlConnection("aa", "bb", "cc", "database");
$srvA->connection; // returns link identifier for server A
$srvB = new MysqlConnection("aa", "bb", "cc", "database");
$srvB->connection; // returns link identifier for server B
....
// both queries are executed
$productsA = new Product($srvA->connection);
$productsA->getCatalog(); //"select * from products;" is executed in server A
....
$productsB = new Product($srvB->connection);
$productsA->getCatalog(); //"select * from products;" is executed in server B
....
$productsB->deleteItem($id_item); //"delete from products where id_item = '" .
$id_item . "';" ... but fails
----
Actually in the class where mysql_query function is being called, I'm using link identifier to
query on the correct database server:
$mq = mysql_query("delete ....", $link_identifier); //passed as $srvA->connection or
$srvB->connection in this example
but mainly in delete statements it responds that link identifier is invalid. All other queries are
executed.