PHP is a server-side scripting language.
What You Should Already Know
Before you continue you should have a basic understanding of the following:- HTML/XHTML
- JavaScript
What is PHP?
- PHP stands for PHP: Hypertext Preprocessor
- PHP is a server-side scripting language, like ASP
- PHP scripts are executed on the server
- PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)
- PHP is an open source software
- PHP is free to download and use
What is a PHP File?
- PHP files can contain text, HTML tags and scripts
- PHP files are returned to the browser as plain HTML
- PHP files have a file extension of ".php", ".php3", or ".phtml"
What is MySQL?
- MySQL is a database server
- MySQL is ideal for both small and large applications
- MySQL supports standard SQL
- MySQL compiles on a number of platforms
- MySQL is free to download and use
PHP + MySQL
- PHP combined with MySQL are cross-platform (you can develop in Windows and serve on a Unix platform)
Why PHP?
- PHP runs on different platforms (Windows, Linux, Unix, etc.)
- PHP is compatible with almost all servers used today (Apache, IIS, etc.)
- PHP is FREE to download from the official PHP resource: www.php.net
- PHP is easy to learn and runs efficiently on the server side
Where to Start?
To get access to a web server with PHP support, you can:- Install Apache (or IIS) on your own server, install PHP, and MySQL
- Or find a web hosting plan with PHP and MySQL support
PhpMyAdmin Tutorial
PhpMyAdmin is web base software used for creating and maintaining MySQL databases. This tutorial is designed to get you starting with the basics of phpMyAdmin.
You can access your MySQL account using phpMyAdmin using the link provided to you --something like below where my-domain.ca is your domain name
http://www.my-domain.ca/phpmyadmin/
When you click on the link above, a dialog box will prompt you for a username and password. This will be the username and password given you when we set it up for you.
The left-hand frame in phpMyAdmin is used for navigation.You will see your database displayed here (in this case called mydomain). As you create tables, they will show below this.
Click on your database the navigation frame and a new window will appear on the right hand side.
Now enter the names and attributes of our table fields. Enter the following information as above:
| Field | Type | Length | Default | Extra |
| id | int | 6 | 0 | auto_increment |
| name | char | 100 | ||
| telephone | char | 50 | ||
| birthday | char | 50 |
Once you've entered all the values, click Save. A screen like this will appear.
Note that you can use Drop to delete a table or fields.
When you are ready we suggest you check out all of the options on this page.
Inputting data into the table.
Click the tab labeled "Insert" - and another window should appear, like this.
Note - if you ever get lost with phpMyAdmin navigation click "Home" in the left hand nav bar and start again.
Now click Save and the record is saved to the people table.
The previous window reappears with the SQL command for the insert. You can keep adding recordsby re-selecting Insert".
For multiple records, you can select the "Insert another new row" radio button on the input form.
When you've finished entering several records into the table, you can check them by clicking on the Browse tab. You can click on individual records for editing or deleting.
Backup your data
You "don't know what you've got 'til its gone"!
- Click on your database name in the left hand navigation bar
- Click on EXPORT (top tab)
- Highlight the table/s you want to back up
- Select STRUCTURE and DATA radio button
- Select "Enclose table and field names with backquotes"
- Select "Save as file" and "zipped" check boxes
- Click "Go" and a zipped archive file will be generated.
Well done! - you've created a database, a table and fields, entered in a few records, viewed the records, edited and perhaps deleted some of them and practised backing up.
No comments:
Post a Comment