CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 test for delete

Print topic Send  topic

Author Message
cata
Posted: 06/25/2003, 7:01 AM

I have a table with phone numbers.An user can have one or more numbers. I create a page where an user can see and could edit and delete only his numbers. Where i can test if an user delete his number and not an other user number? On validate is not fired for delete operation. What should i do in "before delete" event ?
RonB
Posted: 06/25/2003, 7:46 AM

global $yourgrid;
$db=new clsDBConnection1();
//create the check first in sql


$my_check=$db->query("select phonenumber from phonetable where phonumber=" CCToSQL($yourgrid->your_phone_field->GetValue(),"ccsInteger")." and user=" CCToSQL($yourgrid->your_user_field->GetValue(),"ccsInteger"));

if ($my_check== "")

{
$yourgrid->DeleteAllowed = false;
$yourgrid->Errors->addError("Removal of this account is not allowed");

}

unset($db);


Ron

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.