Moron Posted August 25, 2006 Share Posted August 25, 2006 I'm working on an employee leave program. The employee puts the employee number in and all sorts of wonderful things happen! :oBut..... 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? Link to comment https://forums.phpfreaks.com/topic/18642-check-that-database-entry-exists/ Share on other sites More sharing options...
AndyB Posted August 25, 2006 Share Posted August 25, 2006 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. Link to comment https://forums.phpfreaks.com/topic/18642-check-that-database-entry-exists/#findComment-80316 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.