Executes a delete statement with minimal SQL markup and is called from the objSQL class.
mixed obj_delete ( [str table[, str where ]] )
Result resource/object or false on failure.
<?php
try
{
$rs = $dbh->obj_delete( "mytable", "dept='IT'" );
if ( $dbh->obj_error() )
throw new Exception( $dbh->obj_error_message() );
echo $rs->obj_affected_rows();
}
catch ( Exception $e )
{
//log error and/or redirect user to error page
}
try
{
//set arguments using statement argument helper methods
$dbh->obj_table( "mytable" );
$dbh->obj_where( "dept='IT'" );
$rs = $dbh->obj_delete();
if ( $dbh->obj_error() )
throw new Exception( $dbh->obj_error_message() );
echo $rs->obj_affected_rows();
}
catch ( Exception $e )
{
//log error and/or redirect user to error page
}
?>