Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

invalid mySQL result source

shenanigoatsshenanigoats Member Posts: 4
im troubleshooting some php code that i did not write. the code is a simple ordering system that interfaces with a mySQL db. any help would be greatly appreciated.

here is the error that i am getting:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/foxhollo/public_html/Nathan Code/displayorders.php on line 14


here is line 14:

$orders = mysql_query("SELECT DISTINCT * FROM fhforders ORDER BY ordernumber");



and here is the code in its entirety that it is reffering to:

<?php
include("top.inc");

if(isset($tobedeleted)){
mysql_query("DELETE FROM fhforders WHERE ordernumber="$tobedeleted"");
}

echo("<table align="center" width="600" bgcolor="#333333" border="3" bordercolor="black" cellspacing="0" cellpadding="3">" .
"Order Numberusernameitem numberdate");

$tempcheck = "do not confuse me";

$orders = mysql_query("SELECT DISTINCT * FROM fhforders ORDER BY ordernumber");
while ($row = mysql_fetch_array($orders))
{
$ordernumber = $row["ordernumber"];
$username = $row["username"];
$itemnumber = $row["itemnumber"];
$material = $row["material"];
$quantity = $row["quantity"];
$date = $row["date"];


if($tempcheck!=$ordernumber)
{
echo("$ordernumber$username$itemnumber$datedelete");
}

$tempcheck=$ordernumber;
}

echo("");

include("bottom.inc");
?>


Sign In or Register to comment.