Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8385207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:36:39+00:00 2026-06-09T17:36:39+00:00

i am having a problem, i downloaded the project from dev to my local,

  • 0

i am having a problem, i downloaded the project from dev to my local, though it is running fine on dev but on local, it says me the following error
Fatal error: Class ‘DB’ not found in F:\xampp\htdocs\timesheet\index.php on line 9
my index.php is

<?php
    session_start();
    error_reporting(1);
    include_once('classes/db.php'); 
    include_once('classes/functions.php');  

//==========================================
    $dbFun=new DB();
    $dbFun->ConnectToDb();
    $incFun= new Functions();
//==========================================
    if(isset($_GET['file'])){
         $file = $_GET['file'];
    }
    else if(isset($_POST['file'])){
         $file = $_POST['file'];
    }
    else{
           $file = "login.php";
    }  
?>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>::Administration::</title>
<? if(($file != "login.php") && ($_SESSION['sid'] != "")){?>
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="js/CalendarPopup.js" type="text/javascript" language="JavaScript"></script>
<script type="text/javascript" src="js/sortable.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.js"></script>
</head>
<body>

<table width="100%" height="90%" border="0"  align="center" cellpadding="0" cellspacing="0" bordercolor="#1F5F69">
<tr>
  <td height="36" colspan="3" valign="top">
  <table width="100%" height="150" border="0" cellpadding="0" cellspacing="0" style=" background:url(images/topbg.jpg); background-repeat: repeat-x;">

      <tr>

        <td width="30%" rowspan="2" align="left" valign="top"><img src="images/logo_quality_web_programmer.jpg" alt="Miami Truck Guide" width="351" height="151" /></td>

        <td width="70%" height="76" align="right" valign="top"><table width="500" border="0">
          <tr>
            <td align="right" style="color:#FFFFFF;">Welcome <? echo $_SESSION['sid'];?>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="?file=logout.php" style="color:#FFFFFF;">Logout</a>&nbsp;&nbsp;|&nbsp;&nbsp;Search</td>
            <td width="23">&nbsp;</td>
          </tr>

          <tr>
            <td align="right" valign="top"><span id="top-search"><form id="form1" name="form1" method="post" action=""><input name="search" type="text" id="search" />              
            <input type="image" src="images/search.png" name="Submit" value="Submit" /></form></span></td>
            <td>&nbsp;</td>
          </tr>
        </table></td>
      </tr>
    </table></td>
</tr>

<tr>

    <td width="213" rowspan="2" valign="top" style=" background:url(images/leftbg.jpg); background-repeat: repeat-x;">
    <? if($_SESSION['type'] == "Administrator"){
    include("admin_nav.php");
    } else{
    include("emp_nav.php");
    }?></td>
    <td width="11" rowspan="2" valign="top">&nbsp;</td>
    <td width="990" height="10" valign="top"></td>
</tr>
<tr>
  <td valign="top"><? include($file);?></td>
</tr>
</table>
<? } else { include("login.php");}?>

<script type="text/javascript">

$(document).ready(function(){

    //$('#pid').click(function(){
    $("select").change(function(){
    //alert("asma");
    var puid = $("#pid").val();
    document.getElementById(puid).style.display = 'block';
    });

    $("#button").click(function(){
    var frm = document.getElementById("leftform");
        frm.submit();
    });
});

</script>
</body></html>`

and my db.php is

<?
    //include("lang.inc.php");
//========================================
class Variables{ // database variables defined in the class

    var $dbServer;
    var $dbUser ;
    var $dbPass ;
    var $dbName ;

function Variables(){


    $this->dbServer = "localhost";
    $this->dbUser = "root";
    $this->dbPass = "";
    $this->dbName = "timesheet";
    }
}

//+----------------------------------------+
class DB  { // database class contains the function

    var $dbase;
    var $connection;

    function ConnectToDb()
    {
        // Connect to the database and return
        // true/false depending on whether or
        // not a connection could be made.

        $vari=new Variables();

        $this->connection = mysql_connect($vari->dbServer, $vari->dbUser, $vari->dbPass)
        or die("Could not connect : " . @mysql_error());                

        $this->dbase = mysql_select_db($vari->dbName, $this->connection);


        if(!$this->connection || !$this->dbase){            

            return false;
}
        else{                   

            return true;
            }
    }
//==============================    
    function selectMultiRecords($query)
     {   
        if((@$result = mysql_query ($query))==FALSE)
        {
            if (DEBUG=="True")
            {
                echo mysqlMessage($query);      
            }   
        }   
        else
        {   
            $count = 0;
            $data = array();
            while ( $row = mysql_fetch_array($result)) 
            {
                 $data[$count] = $row;
                 $count++;
                //echo "<br>";
            }
                return $data;
        }
    }       
//===============================
    function selectFrom($query)
    {
        if((@$result = mysql_query ($query))==FALSE) 
        {
            if (DEBUG=="True")
            {
                echo mysqlMessage($query);      
            }   
        }   
        else
        {   
            if ($check=mysql_fetch_array($result))
            {
                return $check;
            }
                return false;   
        }
    }
//==========================
function countRecords($query)
    {   
        $res = mysql_query($query);
        $results = mysql_num_rows($res);
        return $results;
    }       

//==============================    
function isExist($query) {  

       if((@$result = mysql_query ($query))==FALSE){
            if (DEBUG == "True"){
                echo mysqlMessage($query);      
            }   
        } else { 
            if ($check=mysql_fetch_array($result)){//mysql_fetch_array return flase if there are no records
                return $check;
            }
        return false;   
        }//else 
    }
        function insertInto($query)
    {   //echo $Querry_Sql;
       if((@$result = mysql_query ($query))==FALSE)
        {
            if (DEBUG=="True")
            {
                echo mysqlMessage($query);      
            }   
        }   
        else
        {   
            return true;    
        }
    }


    function deleteFrom($query)
    {
        if((@$result = mysql_query ($query))==FALSE)
        {
            if (DEBUG=="True")
            {
                echo mysqlMessage($query);      
            }   
        }   
        else
        {   
            return true;    
        }
    }

//================================
function update($query)
    {
        if((@$result = mysql_query ($query))==FALSE)
        {
            if (DEBUG=="True")
            {
              echo mysqlMessage($query);        
            }   
        }   
        else
        {   
            return true;
        }
    }   
    function mysqlMessage($query)
    {
        echo "<div align='left'><strong><font color='red'>Site Name &nbsp;&nbsp;e   r r o r:</font></strong><br>";
        echo "Error in your Query: $query<BR>";
        echo "<strong><font color='red'>m y s q l &nbsp;g e n e r a t e d &nbsp;e r r o r:</font></strong><BR>";
        echo mysql_errno() . " " . mysql_error() . "</div>";
    }   
    //Mail function
function mxmail($to,$subject,$msg, $fromname, $fromemail, $ishtml="true")
{
    $headers  = "MIME-Version: 1.0\r\n";
    if($ishtml=="true")
        $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    else
        $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";

    $headers .= "From: ".$fromname." <".$fromemail.">\r\n";

    @mail($to, $subject, $msg, $headers);
}       

}//========end of class 

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:36:40+00:00Added an answer on June 9, 2026 at 5:36 pm

    Enable short tags on your local server. Or change

    <?
    

    to

    <?php
    

    Ref: http://www.php.net/manual/en/ini.core.php#ini.short-open-tag

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a strange problem I'm having, I've downloaded the WebSharingAppDemo sample from Microosfts
Im having a problem here. i downloaded jake wharton. He gave an example of
Our application downloads data from the internet using RSS but is having connection problems
I'm having a problem when I'm trying to build a project with Maven. I
I have downloaded Xcode 4.2 and I'm having problems viewing my project in the
i am having no problem at all compiling/debugging my web app, but when i
I am having problem building my project (using maven 2) which references some jars
I have a project created with VS2010. I am running the project from VS2008.
I'm pretty new to c++ and I'm having a problem debugging a linker error.
I'm having a problem with a project in Visual Studio 2010 after moving to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.