Note that there are some explanatory texts on larger screens.

plurals
  1. POmy script working on my localhost while not working on internet hosting
    primarykey
    data
    text
    <p>I got this warning on the web hosting, on page (report-hours-male.php) as following</p> <pre><code>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 </code></pre> <p>my problem is: The script is working fine on my localhost >> on my computer while not working on internet hosting !!!!!</p> <p>this is the page</p> <pre><code> &lt;?php include 'config.php'; ?&gt;&lt;BR&gt; Report for year &lt;?php echo $_SESSION['year']; ?&gt; semester &lt;?php echo $_SESSION['sem']; ?&gt; &lt;?php // list of teachers Table rows and total hours echo "&lt;table border='0' id='hor-minimalist-b' &gt; &lt;tr&gt; &lt;th scope='col'&gt;Instructor name&lt;/th&gt; &lt;th scope='col'&gt;Total hours for this semester&lt;/th&gt; &lt;/tr&gt;"; //$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 "&lt;tr&gt;"; echo "&lt;td&gt; ". $row['teacher']." &lt;/td&gt;"; echo "&lt;td&gt; ". $row['SUM(hours)']." &lt;/td&gt;"; echo "&lt;/tr&gt;"; } echo "&lt;/table&gt;"; ?&gt; &lt;!--chart--&gt; &lt;html&gt; &lt;head&gt; &lt;!--Load the AJAX API--&gt; &lt;script type="text/javascript" src="https://www.google.com/jsapi"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; // 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([ &lt;?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)']."]," ; } ?&gt; ['', 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); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;!--Div that will hold the pie chart--&gt; &lt;center&gt;&lt;div id="chart_div"&gt;&lt;/div&gt;&lt;/center&gt; &lt;form&gt; &lt;input type="button" value="Print This Report" onclick="window.print();"&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; &lt;?php ob_end_flush(); ?&gt; </code></pre> <p>this is th config.php</p> <pre><code>&lt;?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(); ?&gt; </code></pre> <p>help me please :(</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload