note 121985 added to mysqli.query

From: Date: Wed, 06 Dec 2017 10:17:04 +0000
Subject: note 121985 added to mysqli.query
Groups: php.notes 
Request: Send a blank email to php-notes+get-209320@lists.php.net to get a copy of this message
This Is A Secure Way To Use mysqli::query -------------------------------------------------------- <?php function secured_query($sql) { $connection = new mysqli($host,$username,$password,$name); if ($connection->connect_error) die("Secured"); $result=$connection->query($sql); if($result==FALSE) die("Secured"); $connection->close(); return $result; } /* $host ---> DataBase IP Address $username ---> DataBase Username $password ---> DataBase Password $name ---> DataBase Name */ ?> ---- Server IP: 208.43.231.9 Probable Submitter: 128.199.193.75 ---- Manual Page -- http://php.net/manual/en/mysqli.query.php Edit -- https://master.php.net/note/edit/121985 Del: integrated -- https://master.php.net/note/delete/121985/integrated Del: useless -- https://master.php.net/note/delete/121985/useless Del: bad code -- https://master.php.net/note/delete/121985/bad+code Del: spam -- https://master.php.net/note/delete/121985/spam Del: non-english -- https://master.php.net/note/delete/121985/non-english Del: in docs -- https://master.php.net/note/delete/121985/in+docs Del: other reasons-- https://master.php.net/note/delete/121985 Reject -- https://master.php.net/note/reject/121985 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#209320) next »