What is there to know about the database? I have a checklist below for learners to use
- Database
- Creating
- Deleting
- Selecting/Using a database
- Field types and their use
- Numerical - int, float
- Strings - char, varchar, text
- Time - date, timestamp
- Tables
- Creating
- Deleting
- Altering tables
- Records
- Inserting records
- Deleting records
- Editing records
- Retrieving records
Once the SQL syntax is known, the next step is to use PHP to execute the SQL commands on the MySQL database server. Among the basic commands that can be use is listed below:
- mysql_connect( ) - Open connection to a MySQL database server
- Description: returns FALSE if fail
resource mysql_connect ([ string $server [, string $username [, string $password [, bool $new_link [, int $client_flags ]]]]] ) - mysql_query( ) - Send SQL commands to MySQL database server
- Description: returns FALSE on error
resource mysql_query ( string $query [, resource $link_identifier ] ) - mysql_select_db( ) - Determine which database name to use on the MySQL database server
- Description: returns TRUE or FALSE
bool mysql_select_db ( string $database_name [, resource $link_identifier ] ) - mysql_fetch_array( ) - Retrieve a record as an array
- Description: returns FALSE if no more records
array mysql_fetch_array ( resource $result [, int $result_type ] ) - mysql_close( ) - Close a MySQL database connection
- Description: returns TRUE of FALSE
bool mysql_close ([ resource $link_identifier ] )
That is all for now. I will write more in coming postings on PHP use with MySQL.
No comments:
Post a Comment