HTML5 and CSS3 All-in-One For Dummies
Book image
Explore Book Buy On Amazon

phpMyAdmin provides terrific features for working with SQL scripts for HTML5 and CSS3 programming. You can write your script directly in phpMyAdmin, or you can use any text editor. Your editor can really help you. Consider a text editor like Notepad++ or Komodo Edit, which both support syntax coloring for SQL. This can really help you find mistakes in your code.

If you’ve written a script in some other editor, you’ll need to save it as a text file and import it into phpMyAdmin.

To run a script in phpMyAdmin, follow these steps:

Connect to phpMyAdmin.

Be sure that you’re logged in and connected to the system.

Navigate to the correct database.

Navigate to the correct database.

Typically, you use a drop-down list to the left of the main screen to pick the database. This phpMyAdmin screen has the haio database enabled.

Activate the SQL pop-up window.

Activate the SQL pop-up window.

You can do so by clicking the small SQL icon in the left-hand navigation menu.

Type your SQL code directly into this dialog box.

This shortcut is good for making quick queries about your data, but generally you create and initialize data with prewritten scripts.

Move to the Import Files tab.

Move to the Import Files tab.

In this tab, you can upload the file directly into the MySQL server. Click the Choose File button to locate your file and the Go button to load it into
MySQL.

You may be nervous that you’ll overwrite the data. You will, but for this stage in the process, that’s exactly what you want. The point of a script is to help you build a database and rebuild it quickly. After you have meaningful data in the table, you won’t be rebuilding it so often, but during the test and creation stage, this skill is critical.

Examine your handiwork.

Examine your handiwork.

Look back at the phpMyAdmin page. It shows your script and, if you ended with a SELECT statement, an output of your table. (Later versions of phpMyAdmin display only the last statement in the script, but all are executed unless there is an error in your script.)

About This Article

This article is from the book:

About the book author:

Andy Harris taught himself programming because it was fun. Today he teaches computer science, game development, and web programming at the university level; is a technology consultant for the state of Indiana; has helped people with disabilities to form their own web development companies; and works with families who wish to teach computing at home.

This article can be found in the category: