This is probabaly a basic request im sure alot of people have implemented on JTABle (jtable.org). I basically want to do a check when adding a new record in the list action file and if the record already exisits to actually spit out a message back to the user that the record already exisists. At the moment I find it sometimes says its inserted but i know it already exisists or I just get an error message which is meaningless to the end user.
I am coding in PHP not ASP
This is my list action , just a snapshot of the Creating a new record :
//Creating a new record (createAction)
$qStr = "INSERT INTO teg_priority(CIDN,CustomerName,Service_Manager,NGM,Tag,CBS) VALUES(" . $_POST["CIDN"] . ", '" . $_POST["CustomerName"] . "' , '" . $_POST["Service_Manager"]."','" . $_POST["NGM"]."','" . $_POST["Tag"]."','" . $_POST["CBS"]."');";
//Insert record into database
$result = mysql_query($qStr);
//Get last inserted record (to return to jTable)
$result = mysql_query("SELECT CIDN,CustomerName,Service_Manager,NGM,Tag,CBS FROM teg_priority WHERE CIDN = " . $_POST["CIDN"] . ";");
$row = mysql_fetch_array($result);
//Return result to jTable
$jTableResult = array();
$jTableResult['Result'] = "OK";
$jTableResult['Record'] = $row;
print json_encode($jTableResult);
}