Can someone tell me what is wrong with this bit of code.
It does not return and error like it is suppose too.
My connection is to a MSSQL Server.
Checked the query on the server and it worked fine.
$e["on_insert"] = array("add_client", null, false);
function add_client($data)
{
global $g;
$check_sql = "SELECT count(*) as c from dbo.[User] where [User_ID] = '".$data["params"]["User_ID"]."'";
$rs = $g->get_one($check_sql);
if ($rs["c"] > 0)
phpgrid_error("Client already exist in database");
}
$g->table = "dbo.[User]";
$g->set_events($e);
1 Answers
Your Answer