From: Operating system: Any PHP version: Irrelevant Package: MySQL related Bug Type: Feature/Change Request Bug description:Add mysql_safe_query
Description: ------------ Since people are bad at securing their code, even when they know how, this function may give securer and more readable code: mysql_safe_query('UPDATE people SET (name, number) VALUES ? WHERE name = ? or ?` = ?', array('new name', 5553475), 'old name', 'custom field', 5); I've provided an example of how to solve this using php code. Test script: --------------- http://pastebin.com/8EcS9y1B -- Edit bug report at https://bugs.php.net/bug.php?id=61004&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61004&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61004&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61004&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61004&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61004&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61004&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61004&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61004&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61004&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61004&r=support Expected behavior: https://bugs.php.net/fix.php?id=61004&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61004&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61004&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61004&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61004&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=61004&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61004&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61004&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61004&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61004&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61004&r=mysqlcfg