I have been at this for 3 hours... am I missing something obvious??? [code]<html> <head> <title> ULEM Registration Database Search Form </title> <body> <?PHP $username="ghf"; $password="gfghgfh"; $database="ghgfh"; $databox="www.ghfhgfh.org"; mysql_connect($databox,$username,$password); @mysql_select_db($database) or die("Unable to select database"); if (isset($_POST['regid'])) { $regid = $_POST['regid']; $query = "select employmentprog, businessprog, certprog, youthprog, parentprog, policyprog, firstname, middlename, lastname, birthdate, street, city, state, postalcode, homephone, otherphone, referral, contact, race, otherrace, gender, regdate from registration where id = $regid"; } if (isset($_POST['lastname'])) { $ln = $_POST['lastname']; $query = "select employmentprog, businessprog, certprog, youthprog, parentprog, policyprog, firstname, middlename, lastname, birthdate, street, city, state, postalcode, homephone, otherphone, referral, contact, race, otherrace, gender, regdate from registration where lastname = $ln"; } $result=mysql_query($query) or die(mysql_error()); $num=mysql_num_rows($result); if ($num == 0) {echo "No matching records."; return;} mysql_close(); echo "<b><center>The results of your search:</center></b><br><br>"; $i=0; while ($i < $num) { $firstname=mysql_result($result,$i,"firstname"); $middlename=mysql_result($result,$i,"middlename"); $lastname=mysql_result($result,$i,"lastname"); $homephone=mysql_result($result,$i,"homephone"); $otherphone=mysql_result($result,$i,"otherphone"); $street=mysql_result($result,$i,"street"); $city=mysql_result($result,$i,"city"); $state=mysql_result($result,$i,"state"); $postalcode=mysql_result($result,$i,"postalcode"); $referral=mysql_result($result,$i,"referral"); $race=mysql_result($result,$i,"race"); $otherrace=mysql_result($result,$i,"otherrace"); $contact=mysql_result($result,$i,"contact"); $gender=mysql_result($result,$i,"gender"); $regdate=mysql_result($result,$i,"regdate"); echo "<b>$firstname $lastname</b><br>Phone: $homephone<br>Other Phone: $otherphone<br>Street: $street<br>City: $city<br>Zip: $postalcode<br>Best time to contact $contact<br>Race: $race<br>Other race (if applicable): $otherrace<br>Gender: $gender<br>Registration date: $regdate<br><hr>"; $i++; } ?> </html>[/code]