PHP MySQL Database functions.
A (hopefully useful) list of some common PHP MySQL functions, what they do, and an example usage.
|mysql_connect()||Creates a database connection||mysql_connect( "mysql_server_hostname", "user", "passwd");|
|mysql_pconnect()||Creates a persistant database connection||mysql_pconnect( "mysql_server_hostname", "user", "passwd");|
|mysql_select_db()||Selects the database to connect to.||mysql_select_db( "DB_name")|
|mysql_query()||Contains the SQL query.||$query= mysql_query( "SELECT * FROM some_table WHERE Name='$somename'")|
|mysql_fetch_row()||fetches a row into an array||$array = mysql_fetch_row( $result )|
|mysql_fetch_array()||Fetches the requested data into an associative or numeric array.||while ($row= mysql_fetch_array( $result ))|
|mysql_num_rows()||Returns the number of rows returned.||$num_rows = mysql_num_rows($query);|
|mysql_create_db()||Create a Database.||mysql_create_db( "DB_name");|
|mysql_drop_db()||Delete a Database.||mysql_drop_db( "DB_name");|
|mysql_free_result()||Frees memory identified with the result identifier. |
(Usually not necessary).
|mysql_free_result( $result );|
This site is totally free to use, you have absolutely no moral or legal obligations to help us continue.
There are however, some costs involved in running the site.
So if this site helped you find your way,
perhaps you could consider contributing to our costs.
Whatever amount you feel this site was worth to you would be just wonderful.
Use PayPal if you do decide to share and help us with the costs and in appreciation for our time and attention, or alternatively buy a book from our Bookstore..
Time in Don's part of the world is: Mon, June 25, 2018 at 00:44 AM
Time in Franki's part of the world is: Monday, June 25, 2018 at 1:44 PM
Don't worry neither one sleeps very long!