I'm working on an employee leave program. The employee puts the employee number in and all sorts of wonderful things happen!
But..... if they put in an invalid (nonexistent) employee number or just some gobbledegook, how can I give them a nice, clean "invalid entry" notice as opposed to SQL errors all over the page?
Check that database entry exists?
1 reply to this topic
Posted 25 August 2006 - 01:07 PM
Do a SELECT from database using their empl. number and then check the number of database rows returned from the query result (use mysql_num_rows). If the number of rows returned isn't 1, then their emp. number wasn't found.
Legend has it that reading the manual never killed anyone.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users