MySQL functions

I am listing here some mysql functions and their descriptions that you will be using during the courses and the example that we will cover later.

If you are interesting to know more function you can check

Fonction Description
mysql_close() closes the non-persistent connection to the MySQL server
mysql_connect() Open a connection to a MySQL Server
mysql_fetch_array() Get a result row as an enumerated array
mysql_fetch_row() Get a result row as an enumerated array
mysql_insert_id() Get the ID generated from the previous INSERT operation
mysql_numrows() Get number of rows in result
mysql_num_rows() Get number of rows in result
mysql_query() Send a MySQL query
mysql_select_db() Select a MySQL database
mysql_fetch_object() Fetch a result row as an object

Other output functions:
Order by lets you choose an output order, giving you Asc output in ascending order, and Desc, the output will be in descending order.

Example of using an output order:

$req mysql_query(“Select name1,email,date from test_tbl Order by id Asc“);

Will display the result from the record with the id 1 to the id 4, if you want the reverse you use Desc instead of Asc.

Limit allows you to limit the number of the query output lines, for example:

$reqmysql_query(“Select name1,email,date from test_tbl Limit 0, 20 “);

Select from the line 0 (the 1st recorded) and displays 20, you can select the 20 recording from any line, for example Limit 10, 20. and so on.

For the next lesson, you’ll find a complete example of coding a guesbook script, you will better understand how mysql and php work.

Filed under PHP and MySQL. You can follow any responses to this entry through the RSS 2.0. You can leave a response by filling following comment form or trackback to this entry from your site

PHP and MySQL' CATEGORY »

Introduction to PHP
Get started with PHP
PHP variables
PHP variables of environment
PHP conditions
PHP Looping
PHP Cookies
PHP working with dates
PHP working with arrays
PHP working with files
PHP play with strings
PHP and Forms
Send emails with PHP
The include statement
Get started with MySQL
MySQL update and delete
The WHERE clause
MySQL functions
Simple PHP guestbook script
Simple PHP websites directory script
Multiple pages with PHP
Create your forum with php

No Responses for “Create your forum with php”

  1. robert says:

    thnk u for the good tutorial

Leave a Reply