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 this is not your bug, you can add a comment by following this link.
If this is your bug, but 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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 10:01:32 2024 UTC