i create a user defined tag "contor"
Code: Select all
$dirname = dirname(__FILE__);
$filename = $dirname."/contor/contornr.php";
require_once($filename);
echo(contornr(session_id());
Code: Select all
function contornr($sid)
{
$locsid = $sid;//sessionid
$ip = GetIP();//client ip
global $gCms;
global $db;
$db =& $gCms->GetDb();
if($db)
{
//select rows which sessionid is = new sessionid
$operation = "SELECT * FROM contornr WHERE sessionid = '".$locsid."'";
$execres = $db->Execute($operation);
if($execres->RowCount() == 0)//if not exist the new sessionid,insert new row
{
...
}
elseif($execres->RecordCount() > 0)//if exist the new sessionid, modify the old one
{
$rcounter = 0;
while($row = $execres->FetchRow())
{
...
}
}
...
return $contor;
}
else
return "";
}
so that here $result = $db->Execute($operation);
$result - is not an object
what i missed?
i think i must something to include in my file
thanks