How to run SQL Queries on a database using phpmyadmin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • VodaHost
    General & Forum Administrator

    • Mar 2005
    • 12356

    How to run SQL Queries on a database using phpmyadmin




    This tutorial is to teach you how to run MySQL queries on a database with phpMyAdmin. We will assume that you are currently logged into phpMyAdmin, and for the purpose of this tutorial, we will use a database with two tables as our example. The phpMyAdmin main screen is broken into two sections. The left hand side is blue, and this is where you will find your database listed. Below the database, you will see the names of the tables that are in the database. The right hand side is a large white window, and this is where the activity takes place.

    To run MySQL queries on a database, the first thing you need to do is click the on the name of the database table that you want to run a MySQL query on. This opens the table details in the right hand of the phpMyAdmin setup window. As you learned in another tutorial, "Deleting fields from database tables with phpMyAdmin", you can delete a field from a table by checking the box in the field row, and clicking on the Delete icon (the big red X below the table). In this tutorial, you are going to learn how to delete a field using pure MySQL commands.

    Go to the right hand side and click on the database name. This will bring up the details for the database in the right hand window of the phpMyAdmin setup. Click the MySQL button at the top of the window. This opens a box, titled "Run MySQL query/queries on database. You will then need to type the MySQL command to delete the field from the table into the box. It would look something like this: ALTER TABLE 'this is where the name of the table goes' DROP 'this is where the name of the field goes' . Then when you are done, you click on Go. A pop-up will ask if really want to perform the action. Click OK. The command screen will then confirm that your MySQL query has been successful. You have just deleted a field from a table.

    For more information about MySQL syntax, visit the MySQL documentation available here. Just click on the icon under the phpMyAdmin name, that has the red MySQL on it. This is the end of this tutorial. You now know how to run a MySQL query on a database using phpMyAdmin setup.

    How to modify fields in database tables using phpmyadmin

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    02036089024 / United Kingdom
    291916438 / Australia

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


Working...
X