[!--quoteo(post=388661:date=Jun 27 2006, 05:21 PM:name=thepip3r)--][div class=\'quotetop\']QUOTE(thepip3r @ Jun 27 2006, 05:21 PM) [snapback]388661[/snapback][/div][div class=\'quotemain\'][!--quotec--] [code] $sql = "SELECT $column FROM $table"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { echo $row['$column']; }[/code] ...displays ALL columns for a specific query in a MySQL database and if you want to write those vars to an array to search: change "echo $row['$column']" to "$array[] = $row['$column']" [/quote] ThePip3r, thanks man could you tell me why this didn't work (which is what I had before) [code] $myarray=array(); for ($i=0; $i<$num_results; $i++) { $username=$row['username']; $myarray[]=$username; } [/code]