We moved our website to a new server and converted our database from mssql to mysql. Now, the resource_dir.php is working, but the next level, resource_cat.php is not working. You can see the pages at:
http://www.birf.info/home/directory/resource_dir.php/
http://www.birf.info/home/directory/resource_cat.php/
The latter page shows the following error:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/fritobag/birf.info/home/directory/resource_cat.php on line 486
Here's a portion of the code. The error, line 486, is the second "while" loop. We'd really appreciate any advice/help we can get. Thanks.
<?php
$db = mysql_connect("erased", "erased", "erased");
mysql_select_db("fritoba_forms",$db);
$titlequery = "select CategoryName from fritoba_forms.Category where CategoryId = XXXX;";
$id = $_REQUEST['cat_id'] ;
$titlequery = str_replace("XXXX", $id, $titlequery);
$query = "select * from fritoba_forms.Provider where fritoba_forms.Provider.ProviderId in (select ProviderId from fritoba_forms.Junction where fritoba_forms.Junction.CategoryId = XXXX);" ;
$query = str_replace("XXXX", $id, $query);
$result = mysql_query($query,$db);
$titleresult = mysql_query($titlequery,$db);
echo "<table border=0>\n";
while ($mytitlerow = mysql_fetch_row($titleresult)) {
printf("<tr><td><font class=\"arthead\">%s</font></td></tr>", $mytitlerow[0]);
echo "<hr width=\"100%\">";
}
while ($myrow = mysql_fetch_row($result)) {
echo "<tr><td><table border=0>";
printf("<tr><td align=\"right\" class=\"fieldlabel\">Company Name:</td><td class=\"arttext\">%s</td></tr>\n", $myrow[1]);
printf("<tr><td align=\"right\" class=\"fieldlabel\">Contact Name:</td><td class=\"arttext\">%s</td></tr>\n", $myrow[2]);
if($myrow[3]) {
printf("<tr><td align=\"right\" class=\"fieldlabel\">Address:</td><td class=\"arttext\">%s</td></tr>\n", $myrow[3]);
} ...........