angyl
01-06-2008, 11:42 PM
I've had a quote database that worked fine for 2 years now. About 2 months ago it just stopped working and I am at a loss as to why. There was nothing wrong with my scripting, because it worked for 2 years. The database still exists and has entries. My home page can count them and can access my updates table. But any time it tries to search for quotes on my sort page it comes back with a zero result. No errors or anything - just a zero result when I have roughly 600 quotes. If I try to circumvent the sorting page and go directly to a quote.php specifying a specific source I still get nothing.
I've looked over the pages to see if it got hacked and something changed, I've moved my database to a new host and I've uploaded pages from my hard drive to verify they weren't changed. Still zero result. I am completely baffled - was there a recent upgrade to php software that renders the code ineffective? That's seriously the only thing I can imagine at this point because I'm at such a loss
I've linked to each of my pages in this entry and the following is my current coding:
home page (http://www.eidolon-solstice.net/eucatastrophe/home.php):
<p>
<?
$result=mysql_query ("SELECT title, ID FROM $category_table ORDER BY title ASC");
if ($row=mysql_fetch_array($result)) {
do { ?>
<a href="sort.php?action=<?=$row["ID"]?>"><?=$row["title"]?></a><br>
<? } while($row = mysql_fetch_array($result));
} ?>
</p>
<p><a href="home.php" target="page">home</a></p>
<?
$resultcount=mysql_query("SELECT ID FROM $table");
$num=mysql_numrows($resultcount); ?> // works just fine
<p>blah blah text <? $num ?> blah blah</p> //works just fine
<?
$result = mysql_query("SELECT * FROM $update_table ORDER BY timestamp DESC");
while ($row = mysql_fetch_array($result)) {
$month = date("m",$row["timestamp"]);
$day = date("d",$row["timestamp"]);
$year = date("y",$row["timestamp"]);
$updates = $row["updates"];
$upID = $row["ID"];
print "<p>~<b>$month-$day-$year</b> $updates</p>"; //works just fine
print "<h3 align=\"right\">";
print "</h3><hr>\n";
}
?>
sorting page (http://www.eidolon-solstice.net/eucatastrophe/sort.php?action=5):
<?
$result=mysql_query("SELECT DISTINCT source, name FROM $table WHERE reatID='$action' ORDER BY source ASC");
$num=mysql_numrows($result); //suddenly returns no result with no errors
?>
<table border="0" cellspacing="0" cellpadding="5">
<tr><td> </td>
<td><b>Quotes</b></td></tr>
<?
$i=0;
while ($i < $num) {
$source=mysql_result($result,$i,"source");
$name=mysql_result($result,$i,"name");
$result2=mysql_query("SELECT ID FROM $table WHERE source='$source'AND reatID='$action'");
$num2=mysql_numrows($result2); // suddenly returns no result
echo "<td><a href=\"quote.php?id=$source\">";
if ($name !=""){
echo "$name</a></td>";
} else {
echo "$source</a></td>"; }
echo "<td><center>$num2</center></td></tr>";
++$i;
}
$result3=mysql_query("SELECT * FROM $table WHERE reatID='$action'");
$num3=mysql_numrows($result3); // suddenly returns a zero result
echo "<td><a href=\"category.php?id=$action\">view all</a></td>";
echo "<td><center>$num3</center></td></tr>";
echo "</table></div>";
?>
</table>
quote page (http://www.eidolon-solstice.net/eucatastrophe/quote.php?action=Buffy):
<?
$result=mysql_query ("SELECT * FROM $table WHERE source='$id' ORDER BY quote ASC");
$num=mysql_numrows($result); // no result returns
$i=0;
while ($i < $num) {
$quote=mysql_result($result,$i,"quote");
$title=mysql_result($result,$i,"title");
$comments=mysql_result($result,$i,"comments");
echo "<p>$quote<br>";
if ($title !=""){
echo " :: $title";
}
if ($comments !=""){
echo " ($comments)</p>\n";
} else {
echo "</p>\n";
}
++$i;
}
?>
any ideas? help?
I've looked over the pages to see if it got hacked and something changed, I've moved my database to a new host and I've uploaded pages from my hard drive to verify they weren't changed. Still zero result. I am completely baffled - was there a recent upgrade to php software that renders the code ineffective? That's seriously the only thing I can imagine at this point because I'm at such a loss
I've linked to each of my pages in this entry and the following is my current coding:
home page (http://www.eidolon-solstice.net/eucatastrophe/home.php):
<p>
<?
$result=mysql_query ("SELECT title, ID FROM $category_table ORDER BY title ASC");
if ($row=mysql_fetch_array($result)) {
do { ?>
<a href="sort.php?action=<?=$row["ID"]?>"><?=$row["title"]?></a><br>
<? } while($row = mysql_fetch_array($result));
} ?>
</p>
<p><a href="home.php" target="page">home</a></p>
<?
$resultcount=mysql_query("SELECT ID FROM $table");
$num=mysql_numrows($resultcount); ?> // works just fine
<p>blah blah text <? $num ?> blah blah</p> //works just fine
<?
$result = mysql_query("SELECT * FROM $update_table ORDER BY timestamp DESC");
while ($row = mysql_fetch_array($result)) {
$month = date("m",$row["timestamp"]);
$day = date("d",$row["timestamp"]);
$year = date("y",$row["timestamp"]);
$updates = $row["updates"];
$upID = $row["ID"];
print "<p>~<b>$month-$day-$year</b> $updates</p>"; //works just fine
print "<h3 align=\"right\">";
print "</h3><hr>\n";
}
?>
sorting page (http://www.eidolon-solstice.net/eucatastrophe/sort.php?action=5):
<?
$result=mysql_query("SELECT DISTINCT source, name FROM $table WHERE reatID='$action' ORDER BY source ASC");
$num=mysql_numrows($result); //suddenly returns no result with no errors
?>
<table border="0" cellspacing="0" cellpadding="5">
<tr><td> </td>
<td><b>Quotes</b></td></tr>
<?
$i=0;
while ($i < $num) {
$source=mysql_result($result,$i,"source");
$name=mysql_result($result,$i,"name");
$result2=mysql_query("SELECT ID FROM $table WHERE source='$source'AND reatID='$action'");
$num2=mysql_numrows($result2); // suddenly returns no result
echo "<td><a href=\"quote.php?id=$source\">";
if ($name !=""){
echo "$name</a></td>";
} else {
echo "$source</a></td>"; }
echo "<td><center>$num2</center></td></tr>";
++$i;
}
$result3=mysql_query("SELECT * FROM $table WHERE reatID='$action'");
$num3=mysql_numrows($result3); // suddenly returns a zero result
echo "<td><a href=\"category.php?id=$action\">view all</a></td>";
echo "<td><center>$num3</center></td></tr>";
echo "</table></div>";
?>
</table>
quote page (http://www.eidolon-solstice.net/eucatastrophe/quote.php?action=Buffy):
<?
$result=mysql_query ("SELECT * FROM $table WHERE source='$id' ORDER BY quote ASC");
$num=mysql_numrows($result); // no result returns
$i=0;
while ($i < $num) {
$quote=mysql_result($result,$i,"quote");
$title=mysql_result($result,$i,"title");
$comments=mysql_result($result,$i,"comments");
echo "<p>$quote<br>";
if ($title !=""){
echo " :: $title";
}
if ($comments !=""){
echo " ($comments)</p>\n";
} else {
echo "</p>\n";
}
++$i;
}
?>
any ideas? help?