Posted by mypapit on Fri 29th Dec 19:47 (modification of post by Anonymous view diff)
diff | download | new post
- //### ( HELP CODE HERE )###
- $msg.="My error msg here";
- }
- if(!$msg){
- //### ( HELP CODE HERE )###
- if($HTTP_SERVER_VARS[HTTP_X_FORWARDED_FOR]!="") $ip=$HTTP_SERVER_VARS[HTTP_X_FORWARDED_FOR]; else $ip=$REMOTE_ADDR;
- $query="insert into bmbi(uid,melayu,english,datereg,ipaddr)values('$userid','$melayu','$english',".time().",'$ip')";
- //## 1) here i have 2 form. which name called melayu & english!
- //## 2) when user add melayu & english the data will insert to db
- //## 3) when user add melayu & english again with same data the db will denied.
- //## 4) here i want to create an error code while ITEM NO 3*
- //
- // return true = no duplicate
- // return false = duplicate detected :p
- //
- function checkDuplicate($english, $english)
- {
- $differ = $time-1800;
- $sql = "SELECT melayu,english FROM bmbi WHERE english='$english' and melayu='$melayu'";
- if (!$result) {
- $error = 'Database error: query failed !'
- echo $error;
- logError($error);
- }
- }
Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.