php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #47550 mysql_real_escape_strings_set()
Submitted: 2009-03-03 10:41 UTC Modified: 2011-04-18 14:05 UTC
From: alexander at vourtsis dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.3.0beta1 OS: Windows Linux OSX
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alexander at vourtsis dot com
New email:
PHP Version: OS:

 

 [2009-03-03 10:41 UTC] alexander at vourtsis dot com
Description:
------------
I'd want to suggest a function to switch escaping of input strings for an sql query.

So far escaping occurs by the use of mysql_real_escape_string(). Using this for each variable can result into a clutter like,

mysql_real_escape_string($test1);
mysql_real_escape_string($test2);
mysql_real_escape_string($test3);
mysql_real_escape_string($test4);

I suggest to create a function to turn real escape string on and off like,

mysql_real_escape_strings_set(1);
and to get if escaping is on:
mysql_real_escape_strings_get();

Thank you in Advance,

Reproduce code:
---------------
---
From manual page: function.mysql-real-escape-string
---



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-01 23:48 UTC] jani@php.net
-Package: Feature/Change Request +Package: MySQL related
 [2011-04-18 14:05 UTC] johannes@php.net
-Status: Open +Status: Bogus
 [2011-04-18 14:05 UTC] johannes@php.net
I don't fully understand what you want. But I assume you want to have some magic to escape some random strings in some situations magically. We won't do that. MAgic makes debugging, etc. way harder! Explicit code makes checking simpler.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 05:01:42 2025 UTC