[snip]
:) Tried that:
[/snip]
Let's be more verbose and see what happens....
if(!($myconnection = mysql_pconnect($server,$user,$pass))){
print("Failed to connect to database!\n");
exit();
}
if(!mysql_select_db($db,$myconnection)){
print("Failed to select database!\n");
exit();
}
$query = "select StudentId from" . $table . "where StudentID = '" .
$StudentID . "' ";
if(!($news = mysql_query($query, $myconnection))){
print("ERROR! " . mysql_error() . "\n");
exit();
}
$howmany = mysql_num_rows($news);
echo "$howmany \n";
if ($howmany == 1){
include ("/the/full/path/to/html/access_error.htm");
} else {
include ("/the/full/path/to/html/registration.htm");
}
It is my guess that your query is failing, so $news is not a valid
resource. Anytime you do a query you should also do a mysql_error()
statement so that a better clue might be printed out.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php