[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

php & mysqli

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 15
Thread images: 2

File: the-php-practitioner.jpg (22KB, 716x474px) Image search: [Google]
the-php-practitioner.jpg
22KB, 716x474px
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.
Thread posts: 15
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.