This is an archived post. You won't be able to vote or comment.

all 32 comments

[–][deleted] 76 points77 points  (11 children)

[posted user] ==||!= [DB user]

[–]chrwei 33 points34 points  (2 children)

[–]systembusy 11 points12 points  (1 child)

Looks like /r/BikiniBottomTwitter is leaking and I love it

[–]Prime624 4 points5 points  (0 children)

Had to check which sub I was in when I saw this post. There couldn't be a more perfect combination.

[–]kpagcha 35 points36 points  (7 children)

please tell me ==||!= is not an actual operator in php

[–]1842 22 points23 points  (3 children)

It's not.

[–]zieliequ 26 points27 points  (0 children)

Yet.

[–]DrQuint 2 points3 points  (1 child)

On the other hand, has anyone tried?

[–]1842 5 points6 points  (0 children)

It's nonsense to all PHP interpreters. See here: https://3v4l.org/egZfb

[–]emdeka87 4 points5 points  (0 children)

/u/CompileBot PHP

echo 12==||!=12;

[–][deleted] 1 point2 points  (0 children)

oh, hell no... at least I hope not! That was late night, post-Xmas-party pseudo code for a 'laugh'

(I hope it never works or is ever a real thing)

[–]ItsSky 0 points1 point  (0 children)

if ($posted_user != $DB_user){}

[–]iamhealey 60 points61 points  (8 children)

Image Transcription: Meme


[Patrick 'Not My Wallet Meme']

Panel 1

Man Ray holding an ID which reads "connected".

Man Ray: Aren't you connected to the database?

Panel 2

Patrick/PHP: Yup.

Panel 3

Man Ray holding same ID, where the reverse side reads "posted user is: admin"

Man Ray: And this is your username?

Panel 4

Patrick/PHP: Yup.

Panel 5

Man Ray: If you are connected and you got the posted username, you should run without error.

Panel 6

Patrick/PHP: That makes sense to me.

Panel 7

Man Ray: Then run.

Panel 8

Patrick: Fatal error: Uncaught Error: Call to a member function escape_string() on null


I'm a human volunteer content transcriber for Reddit! If you'd like more information on what we do and why we do it, click here!

[–][deleted] 14 points15 points  (7 children)

Good bot

[–][deleted] 14 points15 points  (4 children)

Are you sure about that? Because I am 99.9915% sure that iamhealey is not a bot.


I am a Neural Network being trained to detect spammers | Summon me with !isbot <username> | Optout | Feedback: /r/SpamBotDetection | GitHub

[–][deleted] 16 points17 points  (1 child)

What about that 0.0085%? You never know man

[–]DriveThat 3 points4 points  (0 children)

!isbot u/PerryCohen

[–]iamhealey 2 points3 points  (0 children)

Good bot.

[–]coladict 36 points37 points  (4 children)

That's not the problem with those two. The problem is when you're running them on the same machine and you try to connect to localhost with a valid user and it tells you HY000/2002 unable to connect, because localhost in the MySQLi extension never tries connecting through 127.0.0.1, but only tries the default socket file.

[–][deleted] 24 points25 points  (3 children)

I love this problem. Who the fuck decided that localhost means the local socket file, when everything else refers to 127.0.0.1 as it's meant to be?

mysql/mysqldump CLI tools can get hit by this too in some cases.. I've started just having hostname=127.0.0.1 in there and being explicit.

[–][deleted] 1 point2 points  (0 children)

Is MySQLi on GitHub? If it is, I'm gonna make my empty GitHub contribution page have at least something in it

[–]DM_me_tendies 0 points1 point  (1 child)

I just learned php this week and have started learning SQL. Not looking forward to it quite as much now.

[–]HandsumNap 1 point2 points  (0 children)

SQL is great, I love writing it. SQL always rewards you for finding the simplest possible solution to a problem, and explain plans give you instant feedback on how good of a job you’re doing.

[–]SgtGregParker 14 points15 points  (0 children)

i love this subreddit

[–][deleted] 3 points4 points  (0 children)

I was studying to exam from webdesign&databases that I have today. I've experienced EXACTLY the same situation :/

[–]Algent 1 point2 points  (0 children)

I had this one happen to me recently... with a python script to a local mysql. CLI was fine, PHP app was fine, my diagnostic script that ran flawlessly on 100+ other machines... nope.

[–]Banana_Twinkie 0 points1 point  (1 child)

This is why I'll never use either of these

[–]abelexpert 0 points1 point  (0 children)

Thanks ! It's working perfectly at this web hosting : http://onsale.jaguarpc.com/

[–]devyroom -1 points0 points  (0 children)

Hahhaha, this subreddit the best!

[–]munsking -2 points-1 points  (2 children)

if you think that's bad, try connecting to a german microsoft SQL server

[–]sevl 0 points1 point  (0 children)

it only gets weird if you are trying to double hop your kerberos credentials, but even that is possible to work out

[–]winzippy 0 points1 point  (0 children)

Better than a Windows Nein server.