Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, April 20, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Add new records

phpMyEdit Configuration     Add new records
Post new topic   Reply to topic    
 
assaxi     Joined: 30 May 2007   Posts: 2  
Post 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  
Post 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    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy