note 116049 added to function.mysql-real-escape-string

From: Date: Mon, 03 Nov 2014 13:06:07 +0000
Subject: note 116049 added to function.mysql-real-escape-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-200774@lists.php.net to get a copy of this message
Why my code doesn't work؟ function escape($str) { $db=new sql(); if(is_numeric($str)) return $str; else return mysql_real_escape_string($db->connection(),$str); } function connection in class is: public function connection() { $this->connect = mysqli_connect(''localhost","myuser","mypass","mydb"); return $this->connect; } ---- Server IP: 130.185.72.20 Probable Submitter: 5.232.121.143 ---- Manual Page -- http://php.net/manual/en/function.mysql-real-escape-string.php Edit -- https://master.php.net/note/edit/116049 Del: integrated -- https://master.php.net/note/delete/116049/integrated Del: useless -- https://master.php.net/note/delete/116049/useless Del: bad code -- https://master.php.net/note/delete/116049/bad+code Del: spam -- https://master.php.net/note/delete/116049/spam Del: non-english -- https://master.php.net/note/delete/116049/non-english Del: in docs -- https://master.php.net/note/delete/116049/in+docs Del: other reasons-- https://master.php.net/note/delete/116049 Reject -- https://master.php.net/note/reject/116049 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#200774) next »