Skip to content

PHP MySQL functions

August 5, 2009
If your server supports PHP – you don’t need to do anything!
You do not need to compile anything or install any extra tools  – just create some .php files in your web directory – and the server will parse them for you.
Most web hosts offer PHP support
To perform different action we use conditional statements:
if…else statement – use this statement if you want to execute a set of code when a condition is true and another if the condition is not true
elseif statement – is used with the if…else statement to execute a set of code if one of several condition are true
To run a particular code repeatedly we can use looping statements:
while – loops through a block of code if and as long as a specified condition is true
do…while – loops through a block of code once, and then repeats the loop as long as a special condition is true.
PHP functions for MySQL:

mysql_connect  Open a connection to a MySQL Server
mysql_close Close MySQL connection
mysql_create_db Create a MySQL database
mysql_fetch_array  Fetch a result row as an associative array, a numeric array, or both.
mysql_query Send a MySQL query
mysql_select_db  Select a MySQL database
mysql_result  Get result data
mysql_set_charset  Sets the client character set
mysql_error  Returns the text of the error message from previous MySQL operation
mysql_info  Get information about the most recent query
mysql_list_dbs  List databases available on a MySQL server
mysql_list_fields  List MySQL table fields
mysql_list_processes  List MySQL processes
mysql_list_tables List tables in a MySQL database

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: