Index
» Projekty
» phpMyEdit
» Fórum
» Add new records |
|
assaxi
Založený: 30.05.2007
Príspevky: 2
Zaslal: 2007-05-30 10:02
Návrat hore
Odpovedať s citátom
|
How check up or record exist while add new records
|
themanthing
Založený: 24.12.2009
Príspevky: 5
Zaslal: 2012-08-07 09:05
Návrat hore
Odpovedať s citátom
|
You must define the trigger like
Kód: |
$opts['triggers']['insert']['before'] = 'trigg.checkexists.php';
|
then in trigger check exist value by manual query like
Kód: |
$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;
} |
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|