I have been trying to make something do this for hours. I have scoured the net looking for the question previously asked. I found nothing that worked. I found this not very useful posting where the poster said they fixed the error I keep having but did not post the fix. http://codewalkers.com/forum/index.php?action=displaythread&forum=sqlhelp&id=2493&realm=default so I ask with all humbleness and desparation: How do I take the data from one field in a table in a mysql database and create a php array with that data? Or the real goal is to select a random entry from the pagelist field to load a random webpage? I have the following code in use [tt]<?php //connect to database $dbh = mysql_connect ("localhost", "user", "pass") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db("dbname"); $sql="SELECT pagelist FROM pagelist"; $result = mysql_query($sql) or die(mysql_error()); $input = mysql_fetch_array($result); while($row = mysql_fetch_array($result)){ //echo $row['pagelist']; //echo "<br />"; } echo $row[0] ; echo $row[1] ; echo $row[2] ; //random page //$input = array("index.html", "index2.html", "gwbush.html"); $page = array_rand($input); echo $input[$page] . "\n"; ?>[/tt]