This topic is locked

No duplicate record.

3/1/2008 2:52:13 AM
PHPRunner General questions
M
maxcolo author

Good Morning,

sorry for my english but I italian user. I have created one script for petition. The table is very simply:
nome

cognome

email

paese
I would not want to allow to an existing email to insert other records. How do I do?

Best Regards

Max

J
Jane 3/3/2008

Max,
use Before record added event on the Events tab for this purpose.

Here is a sample:

global $conn,$strTableName;

$str = "select count(*) from ".$strTableName." where email='".$values["email"]."'";

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

$data = db_fetch_numarray($rs);

if ($data[0])

return false;

else

return true;

M
maxcolo author 3/3/2008

Grazie

Max