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 7918077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:23:02+00:00 2026-06-03T15:23:02+00:00

I got this warning on the web hosting, on page (report-hours-male.php) as following Warning:

  • 0

I got this warning on the web hosting, on page (report-hours-male.php) as following

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/hatimmak/public_html/ssp12/report-hours-male.php on line 28

my problem is:
The script is working fine on my localhost >> on my computer
while not working on internet hosting !!!!!

this is the page

    <?php


include 'config.php';

?><BR>

Report for year <?php echo $_SESSION['year']; ?>  semester <?php echo $_SESSION['sem']; ?>  

<?php
 // list of teachers Table rows and total hours

echo "<table border='0' id='hor-minimalist-b' >
<tr>
<th scope='col'>Instructor name</th>
<th scope='col'>Total hours for this semester</th>
</tr>"; 


        //$gender = $_SESSION['gender'];
        $year = $_SESSION['year'];
        $sem = $_SESSION['sem'];

        $tab = "Report$year$sem";
        $query = "SELECT teacher, SUM(hours) FROM $tab GROUP BY teacher"; 
        $result = mysql_query($query) ;



while($row = mysql_fetch_array($result))
{


        $time = gmdate(DATE_RFC822);

        //$gender = $_SESSION['gender'];
        $year = $_SESSION['year'];
        $sem = $_SESSION['sem'];
        //$teacher = $_row['teacher'];
        //$sumhours = $_row['SUM(hours)'];



echo "<tr>";
echo "<td> ". $row['teacher']." </td>";
echo "<td> ". $row['SUM(hours)']." </td>";

echo "</tr>";
}
echo "</table>";

?>

<!--chart-->
<html>
  <head>
    <!--Load the AJAX API-->
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">

      // Load the Visualization API and the piechart package.
      google.load('visualization', '1.0', {'packages':['corechart']});

      // Set a callback to run when the Google Visualization API is loaded.
      google.setOnLoadCallback(drawChart);

      // Callback that creates and populates a data table,
      // instantiates the pie chart, passes in the data and
      // draws it.
      function drawChart() {

        // Create the data table.
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Topping');
        data.addColumn('number', 'hours');
        data.addRows([

<?php


        $queryr = "SELECT teacher, SUM(hours) FROM $tab GROUP BY teacher"; 
        $resultr = mysql_query($queryr) ;

while($rowr = mysql_fetch_array($resultr))
{
        $teacherr = $_rowr['teacher'];
        $sumhoursr = $_rowr['SUM(hours)'];


echo "['".$rowr['teacher']."' , ".$rowr['SUM(hours)']."]," ;
}

?>
          ['', 0]


        ]);

        // Set chart options

        var options = {'title':'Contact hours/instructor',
                'legend':'left',
                'is3D':true,

                'width':800,
                'height':300};

        // Instantiate and draw our chart, passing in some options.
        var chart = new google.visualization.BarChart(document.getElementById('chart_div'));
        chart.draw(data, options);
        }
    </script>

  </head>

  <body>
    <!--Div that will hold the pie chart-->
    <center><div id="chart_div"></div></center>

   <form>
<input type="button" value="Print This Report" onclick="window.print();">  </form>

  </body>
</html>

<?php

ob_end_flush();

?>

this is th config.php

<?php

$con = mysql_connect("localhost","hatimmak_ssp","userpass");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

$sel = mysql_select_db("hatimmak_ssp", $con) or die();

?>

help me please 🙁

  • 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-03T15:23:04+00:00Added an answer on June 3, 2026 at 3:23 pm

    i suspect is the values of any of these: $tab, teacher, hours.
    they need to match exactly on your host.

        $tab = "Report$year$sem";
        $query = "SELECT teacher, SUM(hours) FROM $tab GROUP BY teacher"; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this error when following this tutorial . Warning: require_once(...\sf_sandbox\apps\frontend\config\config.php) [function.require-once]: failed to
I got this warning: 'UIView' may not respond to 'addSubview:withAnimation:' The line of code
Got some code that is not mine and its producing this warning atm: iehtmlwin.cpp(264)
I've got a PHP warning in my web app. I'm a bit of a
I ran a Code Analysis and got this message: Warning 5 CA1822 : Microsoft.Performance
While compiling a program in Java I got this big WARNING warning: [unchecked] unchecked
Got this line of code here but its not working. private void Button_Click(object sender,
I just started up django-celery and got this warning: DeprecationWarning: The `celery.decorators` module and
A customer got this Java security warning on one of our ancient java components
From code analysis (Visual studio), I got this warning: Warning 2 CA2000 : Microsoft.Reliability

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.