Hi, I am not sure how you are validating what mysql returns. In php, when you query the table, for example,
//query the table with username AND password
$query = "select * from table where username='test' and password='test'";
//execute the query AND save the resource IN $result.
$result = mysql_query($query);
//If the variable $result IS TRUE AND if the query RETURNS more than 0 rows, (meaning, there IS a record!) THEN display convenient message.
if(mysql_num_rows($result) > 0) {
echo "Username and password exists!";
} ELSE {
//ELSE, no records exist
echo "No records found.";
}
In php however, this will return false if a record doesn't exist in the table. If it has a record, then it will return all the columns of that record as a resource.
I am not sure about Java, but I think mysql will return an empty result set if no records are found.
Moderator
Featured Poster
Reputation Points: 524
Solved Threads: 356
Purple hazed!
Offline 3,878 posts
since Nov 2007