Market Data Analyst (IL)
Next Step Systems
US-IL-Chicago

Justtechjobs.com Post A Job | Post A Resume

PHP Tutorial - Databases in PHP, SQL Basics
The Structured Query Language, SQL, which is commonly pronounced as if it was a word - "seekul", is used to access a database in a modern database management system (DBMS). Now, before we get into coding specific commands in PHP, it is very worthwhile to get an overview of the basic elements of the language and the purpose of those elements.
In SQL everything is done in a "query".  Personally I think this must be because somebody got the idea that since it's a query language, everything must be a query, and made it so even if it's an instruction like "add this record".
That would be an insert query!  Ah well, if I want to be a master of SQL I will have to toe the line an accept the expanded notion of  "queries"!  More about them later -- first, lets take a look at the most common commands you'll see.
Create
It seems logical to begin with the create command, since it is used to create databases and the tables within them.  In practice, databases are usually created outside an application like a PHP program.  They are most frequently created using a management tool of the DBMS.  For this reason, you probably won't write many database create commands.  It is also used to create new tables, however.
Drop
The opposite of create, drop is used to delete databases and tables.  For the same reasons stated for create, you'll probably write more table drops than database drops.
Insert
The first of the record level commands, insert is used to create a record in a table.  Most of the work you do in database systems will involve operations on records.  Remember that a record corresponds to a row in a table (the columns are the data elements, or fields, within a record.)
[ Next Page ]


Comments:
RE: Questionkeshab gopal rout08/24/07 08:53
import excel data to mysql through phppooja07/06/07 04:51
Code PHP and Mysql TUY PHEARIN07/05/07 07:33
QuestionKirti Mishra07/04/07 03:30
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.