Jump to content

Small Problem ;)


skorp

Recommended Posts

Hey guys,

Small problem with a section of my code. I'm getting the error :

[code]Parse error: parse error in c:\\\www\CLockTableCmd.php on line 4[/code]

This is commonly caused by leaving out a ; or )
But i cant see the problem ;)

Heres the code,

[code]<?php
require_once( "DB.php" );

require_once( "CCommand.php");
require_once( "CUnlockTableCmd.php" );
require_once( "settings.php" );
function Execute( $sTableName )
{

$db = DB::connect( $GLOBALS['g_PearDBDSN'] );

If (DB::isError( $db ))
{

$this->OnError("Failed to connect to the database using " . $GLOBALS['g_PearDBDSN'] . $db->getMessage());


return CMD_ERROR;

}


$result = $db->Query( "LOCK TABLES $sTableName WRITE" );

(DB::isError( $result ))

{

$this->OnError("Failed to lock $sTableName");


return CMD_ERROR;

}
{
$this->m_bNeedRollBack = true;

}

return CMD_FINISHED;


}


function OnRollBack()

{

( $this->m_bNeedRollBack == false )

{

return;

}


$unlock = new CUnlockTableCmd( $null );

$unlock->Execute( );
}
}


?>
[/code]

Any help would be great thanks,
skorp
Link to comment
https://forums.phpfreaks.com/topic/29279-small-problem/
Share on other sites

on a side note, you have tons of problems in there.. looks like you have some random brackets laying around, you're missing ifs, you had some stray semicolons initially, you're capitalizing some things you shouldn't be capitalizing "If" and some other things that just make no sense... you really need to go through that code and fix it up, I tried to fix it for you to post here, but there are just some if/then statements missing that I cant do.

Link to comment
https://forums.phpfreaks.com/topic/29279-small-problem/#findComment-134211
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.