#23865 [NEW]: Parametric Queries, and Parametric Stored Procedures in Postgres

From: Date: Wed, 28 May 2003 21:06:11 +0000
Subject: #23865 [NEW]: Parametric Queries, and Parametric Stored Procedures in Postgres
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-40602@lists.php.net to get a copy of this message
From: rcphp at littondale dot dyndns dot org Operating system: Linux (Debian Unstable) PHP version: 4.3.1 PHP Bug Type: Feature/Change Request Bug description: Parametric Queries, and Parametric Stored Procedures in Postgres Feature reqeuest for parametric queries, SQL bind variables, parameterised procedure calls, or whatever people call them ;-) For example pg_query("UPDATE Wibble SET foo=? WHERE wombat=?", $newFoo, $wombat); pg_exec("spAddComment(?,?,?)",$user,$title,$content); A notable feature of these is no need to build dynamic SQL, and remember to addslashes(). Security becomes easier, and if prepared statements can be reused, speed can become better. $stmt = pg_prepare("INSERT INTO Events (date,msg) VALUES (?,?)"); pg_execute($stmt,date(),"Wotzit Flobbled"); ... pg_execute($stmt,date(),"Slime Thoroughly Slaughtered"); (Does PHP have varargs by the way?) Some finer details to sort, due to the way different database backends work. Postgres has stored procedures, but it looks like you SELECT from them, and they behave like functions in other databases. Otherwise though, a good language. - Richard -- Edit bug report at http://bugs.php.net/?id=23865&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23865&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23865&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23865&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23865&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23865&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23865&r=support Expected behavior: http://bugs.php.net/fix.php?id=23865&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23865&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23865&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23865&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23865&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23865&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23865&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23865&r=gnused

« previous php.bugs (#40602) next »