[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]

Why the fuck isn't this working? $query = "SELECT

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: 21
Thread images: 1

File: 1483750290177.gif (876KB, 416x410px) Image search: [Google]
1483750290177.gif
876KB, 416x410px
Why the fuck isn't this working?

$query = "SELECT PersonID, LastName FROM Persons";

if($result = $connection->query($query)){
while($row = $result->fetch_assoc()){
printf($row["PersonID"], $row["LastName"]);
}

$result->free();
}
>>
Why is her head so large?
Why are her hands so small?
>>
>>59394678
I would love to ram my dick in her mouth as she's throwing up.
>>
Not sure how you expect the language to recognise that PersonID etc is a variable and not just part of the string
>>
>>59394729
>doesn't even know the language
This is php. PersonID is a row from a database. I'm trying print the result set
>>
>>59394678
Whats the error output ?
>>
>>59394775
There is no error except the nothing is being printed
>>
Is that first if statement useful /necessary?
>>
>>59394678
Your LastName will never print as the second arg to printf, unless PersonID is a format string
>>
>>59394795
Try an "else echo blah blah".
>>
If but no else? I don't know php srry

Also do you have any data in ur db to see if ur query is working ?

Is ur query shit?
>>
>>59394678
Stop watching those fucking ancient mysql tutorials and use pdo
>>
>>59394746
Well theres ur problem, ur using php
>>
Fuck php. I'm done with this shit.
>>
>>59394678
holy fuck do you realize it's 2017? why aren't you using PDO or some other ORM fucknig CHRIST why aren't you using laravel or lumen what is happening here
>>
>>59394678
Get raped and kill yourself, you retarded fucking faggot sack of ugly nigger shit with down syndrome.
>>
>>59394678
unreadable code works faster
>>
>>59394894
He's probably still learning PHP, so telling him to use ORM frameworks isn't going to help him much. He'll still need to know how to query in PHP for those times when the fucking ORM doesn't do everything for you.

That being said, USE THE MODERN FUNCTIONS OP. You can't use shit that nobody else is using and expect us to be able to help you.

Hell, we don't even know what's not working.
>>
>>59394678
Because you're retarded?
>>
>>59394879
Ah and so we've reached the climax of the thread. Can't get no help from g cause some nigga would rather blame the tool then offer help.

This is exactly why g is cancer now.
>>
>>59394678
Because SQL and PHP is retard tier
Thread posts: 21
Thread images: 1


[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.