Using PHP and MySQL to create dynamic, database-driven Web sites is a breeze. Just remember that the PHP functions are essentially a gateway to the database server; anything you'd enter using the MySQL command-line interface, you can use with mysql_query().

To connect to MySQL with PHP, you need to know your MySQL username, password, and database name. Using mysql_connect() and mysql_select_db(), you can connect to and select a database to use throughout the life of the script.

Once connected, you can issue standard SQL commands with the mysql_query() function. If you have issued a SELECT command, you can use mysql_numrows() to count the records returned in the resultset. If you want to display the data found, you can use mysql_fetch_array() to get all the results during a loop and display them onscreen.

Sams Teach Yourself PHP, MySQL and Apache in 24 Hours
Sams Teach Yourself PHP, MySQL and Apache in 24 Hours
ISBN: 067232489X
EAN: 2147483647
Year: 2005
Pages: 263

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: