include('con.php');
$query = "SELECT user FROM login";
$result = $connection->query("$query");
//etc
//etc
//etc
if(mysqli_free_result($result)){
echo "true";
}else{
echo "false";
}
mysqli_close($connection);
===========
output: "false"
why can't i free $result anon?
>con.php
$connection = new mysqli('localhost','root','root','website');
>>>/wdg/
You are mixing procedural mysqli and mysqli object-style programming
2002 was a good year
>>61833035
pretty sure that method of connecting to mysqli is deprecated, you should be using the object driven one anyway.
>>61833558
>new people learning old techniques because no one suggested the new methods
One of the many reasons PHP is garbage
Why would you use mysqli having PDO?
>>61833739
Mysqli is fine, only mysql_ is deprecated
g-guys?
>>61833836
search for PHP PDO
Use this instead. Really. Make sure you use it right, because sql-injections can kill you. My bird died that way. It was insane.
>>61833765
nah, both are actually deprecated and have been since php 5.5, 5.6 kills it entirely and 7.0 it doesnt even exist.
>>61833558
as long as it's mysqli it's fine. Doesn't matter if you do it procedurally or OOP.
>>61833035
mysqli_free_result has no return value.
>>61834198
PHP7 kills mysql, not mysqli.
>>61833035
>mysqli
>2017
Pick one. Better yet, just use CodeIgniter
mysqli::query returns an object of class mysql_result, not a PHP resource
http://php.net/manual/es/book.mysqli.php
And you should be able to tell the difference between MySQL, the PHP mysql extension and the PHP mysqli extension. Only the mysql extension is gone in PHP 7.