Re: DB insufficient data error

From: Date: Wed, 03 Mar 2004 14:08:15 +0000
Subject: Re: DB insufficient data error
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-11077@lists.php.net to get a copy of this message
This error only raise when you call DB_mysql->buildManipSQL() & DB_mysql->executeEmulateQuery()(see below), see file DB/Common.php for detail: function buildManipSQL($table, $table_fields, $mode, $where = false) { if (count($table_fields) == 0) { $this->raiseError(DB_ERROR_NEED_MORE_DATA); } ... ... ... } function executeEmulateQuery($stmt, $data = false) { .... .... .... if ((!$data && $qp > 0) || (!is_array($data) && $qp > 1) || (is_array($data) && $qp > sizeof($data))) { $this->last_query = $this->prepared_queries[$stmt]; return $this->raiseError(DB_ERROR_NEED_MORE_DATA); } ... ... ... } 1) . buildManipQuery() reason: - This error will be raise when you supply empty array for parameter-2 ($table_fields) solution: - Make sure empty array not supplied. 2. executeEmulateQuery() reason: - function parameter-1 is not array and you have fields in query - function parameter-1 is array but elements count is not equal with fields in query solution - Make parameter-1 is array and elements count is equal with table fields For more easily to found the problem, can you give me the example code? Regards, Firman ----- Original Message ----- From: "Matt Horner" <mhorner@wiredata.com> To: "'Firman Wandayandi'" <fwd@vfemail.net> Cc: "'PHP-GEN'" <pear-general@lists.php.net> Sent: Wednesday, March 03, 2004 1:00 AM Subject: RE: [PEAR] DB insufficient data error Thanks for your response Firman. The database server is MySQL. I have checked the query in the client and verified that the query was correct. However, I have added slashes to the values that are being replaced, and still resulting in the same problem. I am getting the problem whenever there is a special character in the query, such as, ' (single-quote) and ! (exclamation-point), are just a few of the examples that I have tried. A print_r of the object shows the query is being correctly slashed for the single-quote. Any other ideas? Matt

« previous php.pear.general (#11077) next »