note 54277 added to function.pg-affected-rows

From: Date: Wed, 29 Jun 2005 13:15:31 +0000
Subject: note 54277 added to function.pg-affected-rows
Groups: php.notes 
Request: Send a blank email to php-notes+get-91132@lists.php.net to get a copy of this message
Concering Bruno Baguette's note: The pg_query function only allows one query per function call. When you do your $sql="BEGIN; INSERT ... COMMIT;"; $result=pg_query($conn,$sql); echo pg_affected_rows($result); you get a zero, because only the BEGIN; is executed. The single query per call is, I beleive, a PHP builtin protection against SQL injection attacks. (Ie someone submitting a string paramter that ends the current query and appends another one) ---- Manual Page -- http://www.php.net/manual/en/function.pg-affected-rows.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54277 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54277&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54277&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54277&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54277&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54277&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54277&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54277&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91132) next »