note 84885 added to function.mysql-query

From: Date: Mon, 04 Aug 2008 05:04:33 +0000
Subject: note 84885 added to function.mysql-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-143127@lists.php.net to get a copy of this message
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. ---- Server IP: 69.147.83.197 Probable Submitter: 189.149.182.113 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-query.php Edit -- https://master.php.net/note/edit/84885 Del: integrated -- https://master.php.net/note/delete/84885/integrated Del: useless -- https://master.php.net/note/delete/84885/useless Del: bad code -- https://master.php.net/note/delete/84885/bad+code Del: spam -- https://master.php.net/note/delete/84885/spam Del: non-english -- https://master.php.net/note/delete/84885/non-english Del: in docs -- https://master.php.net/note/delete/84885/in+docs Del: other reasons-- https://master.php.net/note/delete/84885 Reject -- https://master.php.net/note/reject/84885 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#143127) next »