I want to cycle through the rows of a database, how can I create a loop to do this with the following:
mysql_connect("localhost", "root", "");
mysql_select_db("main");
$result = mysql_query("select * FROM database");
$array = mysql_fetch_array($result);
//some kind of control loop
{
//do something to each row
}