Hello and thank you for this great site!!!
I have a list of entries attached to an id ($sid) number so the id number is sometimes used more than once. As long as the id number appears only once, it returns the result. When the id number is repeated in the database, it gives the error message “Sorry, the ID you submitted is not present in our database. Please hit your browser’s back button and reenter your student’s ID.” So it will only return results with one line. Anything more returns the error statement.
I’m thinking it’s in the last “if” statement somewhere but I’m too new to PHP to know why.
sql=" SELECT * FROM `volunteer` WHERE sid='$sid'"
or die ("Sorry $id, I Stopped at the select query");
//$results variable = the results of the query
$results = mysql_query($sql)
or die ("Stopped at the mysql_query");
$num=mysql_numrows($results);
$sql1=mysql_query("SELECT sid FROM volunteer WHERE sid='$sid'");
if (mysql_num_rows($sql1)==0 || mysql_num_rows($sql1)>1)
{ die ("Sorry, the ID you submitted is not present in our database. Please hit your browser's back button and reenter your student's ID.");
}
else;
(more code)
What am I doing wroing?
Thank you very much for your help