note 112701 deleted from function.mysqli-connect by philip
| From: | philip@php.net | Date: | Thu, 03 Sep 2015 02:38:21 +0000 |
| Subject: | note 112701 deleted from function.mysqli-connect by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-203604@lists.php.net to get a copy of this message | ||
Note Submitter: john at host2help dot com
----
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.