• About

PHP Lesson 4 Database

August 15th, 2006

PHP has a lot of database functions, which greatly contributed to its popularity. The goal of this lesson is to see how this can work for a simple example. To do so, we will need to complete the following steps:

  1. Connect to a database - hopefully you have a mysql database running already, and you know a user and password to use. Use mysql_connect() function for this.
  2. Query the database, asking it for some information you would like to get. Use mysql_query function for this.
  3. One the database has given you the information, you're not quite ready yet. You will need to access the object and format the rows to a more normalized method. You can use the mysql_fetch_row function to do so.
Yearly Indexes: 2010 2003 2005 2006 2007 2008 2009 2004 2011 2012 2013 2015 2019 2020