Your shopping cart is empty!
There may be times when you want to work with the WordPress database data directly. This can include accessing custom database tables created by a plugin or theme. To do this you'll need to use SQL to query the data from the MySQL database. Remember the WordPress APIs provide access to all of the WordPress tables and only very occasionally will you need to access the tables directly.
One of the most common methods for working with a WordPress database directly is by using phpMyAdmin.
This assumes you have already installed MySQL Admin and set it up so that you can login to the MySQL Database Server either locally or remotely. Refer to the documentation that comes with the installation package of MySQL Admin for your platform for installation instructions.
Begin by accessing phpMyAdmin via cPanel or Plesk.
The records matching your search will be displayed on the screen, and you can interact with them in a variety of ways such as copying, editing or deleting.
The SQL tab appears above all pages inside of phpMyAdmin. This tab is context sensitive, which means that depending on what you're looking at, the target of your SQL queries might be different.
If you are on the home page of phpMyAdmin and do not have any databases selected, if you click on the SQL tab, any queries you run will apply to the overall server (or hosting account if on shared hosting).
If you select a database, any queries run by clicking on the SQL tab will apply to that database.
If you select a table within a database, any queries run by clicking on the SQL tab will apply to that table.
Your SQL query will be executed and the actions you requested will be performed.
A message indicating your table has been created will appear, and your new table will now appear on the list of tables in the database. You can click on the table to see the columns that were created for that table.
The table will be renamed to the new name.
At this point, the table has been dropped from the database, including everything that used to be in it.
If successful, a message will appear stating your table was altered successfully and your new column will appear in the list of columns.
The changes you requested will have been changed.
A message stating your SQL query was executed successfully will be displayed and your columns will be gone.
In a MySQL database, there are three (3) main data types: text, numbers and dates/times. When you design your database, it is important that you select the appropriate type, since this determines why type of data you can store in that column. Using the most appropriate type can also increase the database's overall performance.
The ( ) brackets allow you to specify the maximum number of characters that can be used in the column.
BLOB stands for Binary Large OBject, and can be used to store non-text information that is encoded into text.
By default, the integer types will allow a range between a negative number and a positive number, as indicated in the table above. You can use the UNSIGNED commend, which will instead only allow positive numbers, which start at 0 and count up.
Date/Time fields will only accept a valid date or time.