note 63371 added to function.mysql-affected-rows

From: Date: Tue, 21 Mar 2006 15:09:00 +0000
Subject: note 63371 added to function.mysql-affected-rows
Groups: php.notes 
Request: Send a blank email to php-notes+get-106157@lists.php.net to get a copy of this message
In case you use PEAR::DB and like to write explicit multiple line queries like this: $query = " /* $debug_info */ REPLACE ..."; so that the SQL is nice formatted, easy to read etc. Unfortunatelly this breaks the PEAR $db->affectedRows() that returns always 0: Fix: you need to put the REPLACE/INSERT word immediately after the double quote: $query="REPLACE /* $debug_info */ ..."; (reason is in DB::isManip() in case you're wondering). ---- Server IP: 217.160.72.57 Probable Submitter: 62.240.129.3 (proxied: unknown, unknown) ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-affected-rows.php Edit -- http://master.php.net/note/edit/63371 Del: integrated -- http://master.php.net/note/delete/63371/integrated Del: useless -- http://master.php.net/note/delete/63371/useless Del: bad code -- http://master.php.net/note/delete/63371/bad+code Del: spam -- http://master.php.net/note/delete/63371/spam Del: non-english -- http://master.php.net/note/delete/63371/non-english Del: in docs -- http://master.php.net/note/delete/63371/in+docs Del: other reasons-- http://master.php.net/note/delete/63371 Reject -- http://master.php.net/note/reject/63371 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#106157) next »