This topic is locked
[SOLVED]

 Check if record exis

10/1/2012 9:26:34 PM
PHPRunner General questions
B
bujar.gashi author

Hi to all ,
I need to create event that :

before record added to check if the specific id or name exist into table if yes alert to be like popup or message (which message should include location of existing record ..id )and record to be able for adding even the record exist .
Best regards

B

D
danaci 10/1/2012

global $conn;

$strSQL = "SELECT id, name FROM your_table WHERE id='".$values["id"]."'";

$rs = db_query($strSQL,$conn);

$data = db_fetch_array($rs);

if($data) {

echo "record exist..!";

}