Page 1 of 1

FATAL ERROR HELP

Posted: Mon Jun 02, 2008 12:59 pm
by Adza
HELP

My index page keeps getting this error and i've done all i know to correct it help anyone

Here is the error screen:

PConnect($DBHOST, $DBUSER, $DBPASSWORD, $DBNAME); $sql = "SELECT * from sconfig"; $rsc = $conn->Execute($sql); if($rsc){while(!$rsc->EOF) { $field = $rsc->fields['soption']; $config[$field] = $rsc->fields['svalue']; STemplate::assign($field, $config[$field]); @$rsc->MoveNext(); }} STemplate::assign('bgcolor','#E8E8E8'); STemplate::assign('BASE_URL', $config['BASE_URL']); STemplate::assign('BASE_DIR', $config['BASE_DIR']); STemplate::assign('IMG_URL', $config['IMG_URL']); STemplate::assign('baseurl', $config['BASE_URL']); STemplate::assign('basedir', $config['BASE_DIR']); STemplate::assign('imgurl', $config['IMG_URL']); STemplate::assign('vdourl', $config['VDO_URL']); STemplate::assign('adourl', $config['ADO_URL']); STemplate::assign('flvdourl', $config['FLVDO_URL']); STemplate::assign('tmburl', $config['TMB_URL']); STemplate::setCompileDir($config['basedir']."/templates_c"); STemplate::setTplDir($config['basedir']."/templates"); ?>
Notice: Undefined variable: conn in C:\wamp\www\vid site\index.php on line 9

Fatal error: Call to a member function Execute() on a non-object in C:\wamp\www\vid site\index.php on line 9


Here is the PHP:

Code: Select all

<?php
include("include/config.php");
session_start();
include("include/function.php");
 
# Find the vote information 
$mydate= date('Y-m-d');
$sql ="select * from poll_question  where start_date<='$mydate' and end_date>='$mydate'";
$rs = $conn->Execute($sql);
$x=$rs->getarray();
$list=explode("|", $x[0]['poll_answer']);
STemplate::assign('poll_id',$x[0]['poll_id']);
STemplate::assign('poll_qty',$x[0]['poll_qty']);
STemplate::assign('list',$list);
 
//PAGING
$items_per_page=($config['rows_per_page']*$config['cols_per_page']);
$sql="SELECT * from video where type='public' and featured='yes' order by addtime desc";
$rs = $conn->Execute($sql);
if($rs->recordcount()>0)$users = $rs->getrows();
//END PAGING
 
$sql1 = "select VID, title, viewtime, vkey from video where viewtime<>'0000-00-00 00:00:00' order by viewtime desc limit 0, ".$config['recently_viewed_video'];
$rs_v = $conn->execute($sql1);
$recent = $rs_v->getrows();
STemplate::assign('recent', $recent);
STemplate::assign('recent_total', count($recent));
 
if ($_REQUEST['msg']!=""){
    $msg=$_REQUEST['msg'];
}
 
STemplate::assign('err',$err);
STemplate::assign('msg',$msg);
STemplate::assign('answers',$users);
STemplate::assign('total',$rs->recordcount());
$sql="SELECT * from video where type='public' order by addtime desc limit 100";
$tags=group_tags($sql);
STemplate::assign('tags',$tags);
STemplate::assign('head_bottom',"homelinks.tpl");
 
if($config['enable_package']=="yes" and $_SESSION['UID']!="")
{
        $sql = "select * from subscriber where UID=$_SESSION[UID]";
        $rs = $conn->execute($sql);
        $u_info = $rs->getrows();
        STemplate::assign('u_info', $u_info[0]);
        $rs->movefirst();
        
        $sql = "select * from package where pack_id=".$rs->fields['pack_id'];
        $rs = $conn->execute($sql);
        $pack = $rs->getrows();
        STemplate::assign('pack', $pack[0]);
}
 
STemplate::display('head1.tpl');
STemplate::display('err_msg.tpl');
STemplate::display('search.tpl');
STemplate::display('index.tpl');
STemplate::display('right.tpl');
STemplate::display('footer.tpl');
?>
 

Re: FATAL ERROR HELP

Posted: Mon Jun 02, 2008 1:31 pm
by califdon
Fatal error: Call to a member function Execute() on a non-object in C:\wamp\www\vid site\index.php on line 9
Well, it's telling you that in your line 9:

Code: Select all

$rs = $conn->Execute($sql);
it doesn't recognize $conn as an object. I would think that might be due to the fact that you haven't instantiated an object in your previous code, but since you haven't shown your include file, there's no way that I can guess what's wrong.