peter.t Posted August 5, 2008 Share Posted August 5, 2008 Hello, I've got an insert/update form (created using dreamweaver developer toolbox). That part was easy, however I'm stuck on this particular validation. When I click the Insert button, here's what I need to have happen: ...check the db table the info is being entered into (dlog_test) to see if any records contain the same time (time_dal) and date (date_dal). If there are records with the same time and date and the number of rows of records = 3, then I need an error message to appear and say "This timeslot is already filled." I'm just not having any success with what I've tried so far. I'm hoping this code below is close...I have this code in my Custom Trigger. $query = "SELECT COUNT(*) AS NUMBER FROM dlog_test WHERE dlog_test.time_dal = ".KT_escapeForSql($tNG->getColumnValue("time_dal"),$tNG->getColumnType("time_dal"))." AND dlog_test.date_dal = ".KT_escapeForSql($tNG->getColumnValue("date_dal"),$tNG->getColumnType("date_dal")); $result = $row_rsCount == 2; if(!$result) { $error = new tNG_error("Timeslot is filled!",array(),array()); return $error; } Any chance I'm on the right track? Thanks! Link to comment https://forums.phpfreaks.com/topic/118296-custom-trigger-using-dreamwever-developer-toolbox/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.