Pros and cons for switching to MariaDB from MySQL?

What are the advantages of switching to MariaDB from MySQL? And are there any disadvantages? If you like me, you may have only just heard about MariaDB. I came across it as a new option when adding a database to RackSpace Cloud hosting environment. After a quick read up about MariaDB and seeing that it […]

When do you need to use back ticks with MySQL?

Back ticks are often misunderstood. I am trying to learn the best way to write queries. You might not be sure how to use those funny little `ticks `back ticks`, `backticks` I have used single quotes, double quotes and back ticks without any real thought. What is the standard for this? Back ticks should be […]

How to use CodeIgniter to prevent malicious SQL injections

Should you escape input when using CodeIgniters active record class? Do you need to worry about MySQL injection vulnerabilities when using CodeIgniter? Yes, yes you do. It is of course good security practice. To escape your data before submitting it into your database. CodeIgniter provides three helpful methods. Which are part of it’s database library […]

MySQL terminology guide for newbies

MySQL Terminology helpful guide If you are newbie to MySQL, this guide explains some terminology that is used when developing with MySQL and PHP. This is not meant to be a definitive guide, but will be updated. Did I miss something? Please let me know or leave a comment below. Aliases for column names Produces […]

How to replace NULL values in a MySQL SELECT statement

Sometimes when you are SELECTing data from MySQL, some of your columns may have NULL data values and NULL’s don’t display well to end-users, so it may be best to replace the NULL’s with a string of text instead such as: “Not defined” “Undefined” “Default value” You could do this in PHP when you are […]

When to use USING in a JOIN rather than JOINing ON?

What is the difference between ON and USING() when JOINing two or more tables together in a SQL query? For example you have the following two tables, Users and Products, when a Product is created, the Users id that created it is stored. Products table: id Primary Key created_by_user_id Foreign Key to Users table product_name […]

How to join the same table twice in a single SQL query statement?

Having more than one join to the same table can be confusing. You might not have even thought it was possible to have multiple joins to the same table. It is possible and easy to do with the help of aliases. Aliases for table names Aliases allow you to reference the table name with an […]

MySQL phpMyAdmin Tutorial, creating tables and joining tables together

Check out my first video tutorial on YouTube. I’m demonstrating MySQL phpMyAdmin, to get you started creating a database, creating and populating two MySQL tables and a simple SELECT statement showing how to join the two tables together. The text size does look a little small, so the next video will be zoomed in to […]

GUI clients to help you manage a MySQL database

How do you manage a MySQL database through a GUI? What client should you use for managing remote MySQL? There are many options, I’ve almost always used phpMyAdmin and found it good enough for most common tasks. I’ve needed to use the console for loading large files of data for example. You can find other […]

What’s better for newbies to learn first PHP or MySQL?

It’s a good question for newbies to have, where to start? What comes first PHP or MySQL?  The chicken or the egg? You can learn both independently, but if you have no experience with either, I think it’s best to start with PHP.   Pretty quickly as you work through tutorials you will encounter MySQL. […]