I have created a small registration sticky form. Everything is working fine, but if I input any wrong value,like numbers in name, letters in age or even wrong email format, then
As for your first question, don't check for $var
, check for !empty($var)
.
Second question: I am not sure I understand what you are trying to do. But don't you mean $row
instead of $rows
when you are displaying something? Also, what if you have more than one search hit? What you want is:
while($row=mysql_fetch_assoc($result)){
echo $row['Firstname'], ' ', $row['LastName'];
}
instead of your if-else construction.