Note that there are some explanatory texts on larger screens.

plurals
  1. POUnexplained PHP/MySQL error. Code works on my test server, but not the permanent server
    primarykey
    data
    text
    <p><a href="http://zeel.dyndns.org/ss/home/" rel="nofollow">http://zeel.dyndns.org/ss/home/</a></p> <p>This is the homepage for my site on my test server, it works great. So do all the other pages. However on my permanent remote server (justhost)</p> <p><a href="http://cvca.ohiofbla.org/store/home/" rel="nofollow">http://cvca.ohiofbla.org/store/home/</a></p> <p>I get:</p> <blockquote> <p>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in<br> /home/ohiofbl1/public_html/schools/cvca/store/home/index.php on line 43</p> </blockquote> <p>I don't see any problems in the code, and the same code works fine on the testing server.<br> The only difference is that I have an included file that defines variables for SQL user/pass/dbname that are different depending on the server. But the only file that is different is that include file.</p> <p>Am I missing something?</p> <pre><code>&lt;?php session_start(); require("../includes/config.php");?&gt; &lt;?php $title = "Home"; ////////////////////////////////////////////?&gt; &lt;?php require("../includes/head.php"); ///////////////////////////////////////////////////////////////////?&gt; &lt;?php $con = mysql_connect($dbhost,$dbuser,$dbpass); if (!$con) { die('Could not connect: ' . mysql_error()); }?&gt; &lt;div id="index_structure"&gt; &lt;div id="index_left"&gt; &lt;div id="index_top"&gt; &lt;h2&gt;Welcome to the CVCA School Store! &lt;/h2&gt; &lt;p&gt;Here you can purchase items from the school store, and then pick them up from school the next day. &lt;/p&gt; &lt;/div&gt; &lt;div id="index_bottom"&gt; &lt;p align="center"&gt;&lt;img src="../images/School Store 014.png" width="30%" /&gt;&amp;nbsp; &lt;img src="../images/School Store 015.png" width="30%" /&gt;&amp;nbsp; &lt;img src="../images/School Store 016.png" width="30%" /&gt;&lt;/p&gt;&lt;br /&gt; &lt;p&gt;&lt;strong&gt;Hours:&lt;/strong&gt; Mon - Fri, 7:45 - 8:05 AM. On school days. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Location:&lt;/strong&gt; Corner of west cafe &lt;/p&gt; &lt;p&gt;Backpack sales start in May - August for all new 7th graders. Supplies are available year round.&lt;/p&gt; &lt;p&gt;Empty shoeboxes are accepted for Operation Shoebox at all times. &lt;/p&gt; &lt;p&gt;We are always looking for parent helpers and student employees. &lt;/p&gt; &lt;p&gt;School uniforms are available for fitting purposes. Uniforms are available for purchase at &lt;span class="bluelink"&gt;&lt;a href="http://cvcastore.com/"&gt;cvcastore.com&lt;/a&gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="../images/shirts.png" width="32%" /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt; &lt;div id="index_sidebar"&gt; &lt;h3 align="left"&gt;Featured items:&lt;/h3&gt;&lt;hr /&gt; &lt;?php function random_one($dbname, $con) { mysql_select_db($dbname, $con); unset($result); unset($col); $i = 1; while($i = 1) { $result = mysql_query("SELECT * FROM items\n"."ORDER BY RAND()\n"."LIMIT 1"); $col = mysql_fetch_array($result); //This is line 43 from the error if (file_exists("../" . $col['ImagePath']) == true) { echo "&lt;h4&gt;&lt;a href='../item/?item=" . $col['ItemNumber'] . "'&gt;" . $col['ItemName'] . "&lt;/h4&gt;&lt;br /&gt; &lt;img src='../" . $col['ImagePath'] . "' border='0' /&gt;&lt;/a&gt;"; break; } } ?&gt;&lt;hr /&gt;&lt;?php } random_one($dbname, $con); random_one($dbname, $con); random_one($dbname, $con); ?&gt;&lt;/div&gt;&lt;/div&gt; &lt;?php require("../includes/foot.php"); ///////////////////////////////?&gt; </code></pre>
    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.
 

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