note 112701 added to function.mysqli-connect

From: Date: Mon, 15 Jul 2013 03:30:46 +0000
Subject: note 112701 added to function.mysqli-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-195613@lists.php.net to get a copy of this message
The above by djfenix_31_94 at hotmail dot com is excellent - but $query = "SELECT name FROM mytable" or die("Error in the consult.." . mysqli_error($link)); # execute the query. $result = $link->query($query); This is wrong - the or die will never be called in the above. It should read: $query = "SELECT name FROM mytable"; # execute the query. $result = $link->query($query) or die("Error in the consult.." . mysqli_error($link)); it took me a few plays to see that, hope it saves someone else a few minutes. ---- Server IP: 69.147.83.199 Probable Submitter: 71.236.137.113 ---- Manual Page -- http://php.net/manual/en/function.mysqli-connect.php Edit -- https://master.php.net/note/edit/112701 Del: integrated -- https://master.php.net/note/delete/112701/integrated Del: useless -- https://master.php.net/note/delete/112701/useless Del: bad code -- https://master.php.net/note/delete/112701/bad+code Del: spam -- https://master.php.net/note/delete/112701/spam Del: non-english -- https://master.php.net/note/delete/112701/non-english Del: in docs -- https://master.php.net/note/delete/112701/in+docs Del: other reasons-- https://master.php.net/note/delete/112701 Reject -- https://master.php.net/note/reject/112701 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#195613) next »