Dont know what to put in my db.php,
I’m getting this error,
fatal error: Undefined class name 'db' in c:programfileseasyphp1-8wwwCLockTableCmd.php on line 11
This is my CLockTableCmd.php
[php]<?php
require_once( “DB.php” );
require_once( “CCommand.php” );
require_once( “CUnlockTableCmd.php” );
require_once( “settings.php” );
class CLockTableCmd extends CCommand
{
function Execute( $sTableName )
{
// connect to the db
$db = DB::connect( $GLOBALS[‘g_PearDBDSN’] );
if (DB::isError( $db ))
{
// let everyone know that there has been a problem
$this->OnError("Failed to connect to the database using " . $GLOBALS[‘g_PearDBDSN’] . $db->getMessage());
// return failure
return CMD_ERROR;
}
// try to lock
$result = $db->Query( “LOCK TABLES $sTableName WRITE” );
if (DB::isError( $result ))
{
// let everone know there is a problem
$this->OnError(“Failed to lock $sTableName”);
// return failure
return CMD_ERROR;
} else {
// it is only if we reach this far that we
// need to worry about rolling back the command
$this->m_bNeedRollBack = true;
}
// this command is successfully completed
return CMD_FINISHED;
}
function OnRollBack()
{
// if we don’t need to roll back, don’t
if ( $this->m_bNeedRollBack == false )
{
return;
}
// create an instance of the unlock table command with no parent
$unlock = new CUnlockTableCmd( $null );
// execute it to unlock the table
$unlock->Execute( );
}
}
?>[/php]
Any help would be great thanks