php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32186 mysqli_real_escape_string
Submitted: 2005-03-04 10:58 UTC Modified: 2005-03-04 11:50 UTC
From: gabriel dot preda at amr dot ro Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5CVS-2005-03-04 (dev) OS: Fedora Core 2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gabriel dot preda at amr dot ro
New email:
PHP Version: OS:

 

 [2005-03-04 10:58 UTC] gabriel dot preda at amr dot ro
Description:
------------
mysqli_real_escape_string is corrupted !

Reproduce code:
---------------
$u = $_POST['uname'];
$p = $_POST['pword'];
echo $u . "-" . $p;
$mysqli = new mysqli($MYSQL['server'], $MYSQL['username'], $MYSQL['password'], $MYSQL['database']);
$mysqli->query("SET NAMES '".$MYSQL['charset']."'");
print "<br />";
var_dump($mysqli);
$u = $mysqli->real_escape_string($u);
echo "<br />-----".$u."----";

Expected result:
----------------
username-password
object(mysqli)#1 (0) { } 
-----username----


Actual result:
--------------
username-password
object(mysqli)#1 (0) { } 
---------

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-04 11:50 UTC] gabriel dot preda at amr dot ro
Sorry... my mistake...
The problema was because MySQL introduced the ANONYMOUSE account... the MySQLi returned the object but I had no priviledges to any database !

Sorry ! Me culpa !
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Sep 28 05:03:38 2021 UTC