Index
» Projects
» phpMyEdit
» Forum
» Add new records |
|
assaxi
Joined: 30 May 2007
Posts: 2
Posted: 2007-05-30 10:02
Back to top
Reply with quote
|
How check up or record exist while add new records
|
themanthing
Joined: 24 Dec 2009
Posts: 5
Posted: 2012-08-07 09:05
Back to top
Reply with quote
|
You must define the trigger like
Code: |
$opts['triggers']['insert']['before'] = 'trigg.checkexists.php';
|
then in trigger check exist value by manual query like
Code: |
$data = $this->myquery("SELECT Id FROM YOUR_TABLE WHERE your_value = '".$newvals['your_value']."'");
$row = mysql_fetch_row($data);
if ( $row[0] ) {
echo "<DIV class=\"message\">IT EXISTS!</DIV>";
return false;
}
else {
return true;
} |
|
Post new topic
Reply to topic
|
|
|
|