Ok I have a problem and with my limited knowledge of PHP/MySQL i do not know
the solution.

Here is my problem:
if fields are empty throw this error - works
else if (duplicate record found on insert) throw this error - no clue how to
do this - or what the condition would be and how to receive it from Php
else (insert the variables) - works

On the MYSQL side of things I am using MySQl Control Center which allowed me
to create Client_FName as a UNIQUE Index.

Another set of eyes/thoughts would be great and very much appreciated

rigpig


_root.prospect.information.sample3_lv = new LoadVars();
_root.prospect.information.ButtonA.onRelease=funct ion(){
if(_root.prospect.information.ClientFName_txt.text == ""){
_root.validate._visible = true;
stop();
} else if (what is this condidtion supposed to be?){
_root.DuplicateMsg._visible = true;
stop();
} else {
_root.prospect.information.sample3_lv.ClientFName =
_root.prospect.information.ClientFName_txt.text;

_root.prospect.information.sample3_lv.sendAndLoad( "http://localhost/php/AddA
lien.php", _root.prospect.information.sample3_lv, "POST");
_root.prospect.nextFrame();
}

here is my php code

//Set common variables
$Host="localhost";
$DBName="MyDatabase";
$TableName="prospects";

//1: Connect to Database
$Connect=mysql_connect($Host, $User, $Passwd);

//2: Select Database
mysql_select_db($DBName, $Connect);
//3: Check for duplicate information with all required fields being equal
if(mysql_result(mysql_query("SELECT COUNT(*) FROM prospects WHERE
Client_FName='$ClientFName' "), 0))
echo "$DuplicateMsg";
//4: Create MySQL command Query
$Query="INSERT INTO $TableName (Client_FName) VALUES('$ClientFName')";
//5: Send Query to MySQL, Adds new entry to database
mysql_query($Query, $Connect);

echo "$SuccessMsg";