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 options out there listed below:

Which one do you use, do have a favorite GUI for managing MySQL databases? Let me know in the comments below…

If you liked this, be sure to subscribe below and be the first to get my next post…

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.  They really go hand in hand for many applications.

If you have zero experience, there are other things you will need to learn also if you haven’t already…

  • HTML
  • CSS
  • Javascript / JQuery

How to join three MySQL database tables together in a simple SELECT statement

Following on from my post of how to join two MySQL tables together, adding a third table is just as easy, but if you need an example this one extends the previous post by adding a third table.

For example I have a table of products, table of product categories and table of product suppliers, how to return the category description of each product and the supplier of the product?

Products
———–
id
category_id
supplier_id
product_name

Categories
————-
id
description

Suppliers
—————
id
supplier_name
supplier_address

In it’s simplest form you would join three tables based on the relationship between a key and it’s foreign key stored in another table:

SELECT p.id, p.product_name, c.description AS ‘cat_description’, s.supplier_name
FROM products p
INNER JOIN categories c on p.category_id = c.id
INNER JOIN suppliers s ON p.supplier_id = s.id

Using a well designed relational database and JOINed queries will make your PHP code simpler and more efficient by returning the data from two or more tables in one query.

Like this post? please leave a comment below:

Still using the old MySQL driver? What you need to know about MySQLi…

Its time to upgrade from the PHP MySQL extension

The PHP MySQL extension was deprecated in PHP 5.5.0!

You should upgrade your code to use MySQLi at least, even better would be upgrading to PDO.

This post about selecting data uses PDO and has the full source code available for you.

But back to MySQLi

The “i” in mysqli stands for IMPROVED, its not only new it’s improved too.

If you are still using the plain old mysql driver you should check to see if you can use mysqli.

All you need is PHP 5.4 or greater and add that “i”!

Once you get to PHP 5.5 or above mysql will no longer be supported.

Your queries will run faster, be more efficient and you can make use of more great features like prepared statements and it’s object oriented interface.

If you are using a PHP framework like CodeIgniter, switching should be a breeze, you just need to add the “i”.

For example you might have this in your code:

<?php
$db['default']['dbdriver'] = 'mysqli';
?>

If you aren’t using a framework, please consider upgrading your code, depending on your hosting company they might upgrade their PHP version without warning!

It has happened before!

Then you will need to be fixing and upgrading your code under pressure while your website is down!

How to join two MySQL database tables together in a simple SELECT statement

How to join two MySQL database tables together in a simple SELECT statement?
For example I have a table of products and a table of product categories, how to return the category description of each product?
Products
———–
id
category_id
product_name

Categories
————-
id
description

A. In it’s simplest form you would join two tables based on the relationship between a key and it’s foreign key stored in another table:
SELECT p.id, p.product_name, c.description AS ‘cat_description’
FROM products p
INNER JOIN categories c on p.category_id = c.id

Using a well designed relational database and JOINed queries will make your PHP code simpler and more efficient by returning the data from two or more tables in one query.

Like this post? please leave a comment below: