Down The Rabbit Hole with the Back-Tick

I made a MySQL query a few days ago and came across a problem to be mindful of.

Or so I thought.

phpMyAdmin is a really great tool for learning MySQL queries. Often, when you click on something, phpMyAdmin will reveal the SQL query that was made to get the result you were looking for. A simple Copy/Paste, maybe a quick modification to meet your needs, and you’re on your way.

I copied. I pasted. I got a whole lot of errors.

Then I removed the back-tick, saved, and refreshed. And, Viola! Success!

Success???

But, I did some research and found that MySQL doesn’t care if the back-tick is there or not (at least in the way I’m using it). So I tried putting them back in and it still worked. I’m not 100% sure why. My best guess is I did a Save-All instead of just a Save. This may have saved the file that contained the fix to my code that just hadn’t been saved yet.

So, I did some research, and After finding this: https://www.quora.com/What-is-the-the-character-under-the-tilde-called-and-how-can-it-be-used-in-PHP-programing?share=1 I began to learn something more concrete than “It worked last time like this.”

This was one of those problems where you learn a lot. You start to peel back the layers and learn what a seemingly insignificant character is capable of.

I learned it’s possible to run system commands from PHP. I had no idea. But, I’m glad I found it because it’s provided me with a possible solution for an idea I’ve had for awhile.

That’s how it works. One piece of information at a time. Sometimes, something new shows up in an unexpected place. Because of this, I believe it’s worth looking past a simple copy/paste solution and getting a better, more thorough understanding of the problem.

Published by tim@timardan.com

I like making life easier with tech. Small stuff. Big stuff. Whatever.

Leave a comment

Your email address will not be published. Required fields are marked *