I cant seem to find out whats wrong with this code!!
<head>
<title>Anmar Accounts - Input Into DB</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p align="center"><img src="imgs/anmarlogo.gif" width="247" height="89"></p>
<p align="right"></p>
<p align="center"><a href="searchform.php">Search</a> - <a href="inputform.php">Add</a><BR>
<?
include("dbinfo.php");
// retrieve all info from that month and put into a table
$db=mysql_connect("$dbhost", "$dbuser", "$dbpass");
if(!(mysql_select_db("$dbname",$db)))
die("Can't Connect");
$curmonth = date("m");
// echo "$curmonth";
if(!($sql="SELECT * FROM 200110"))
die("No SQL");
if(!($result = mysql_query($sql,$db)))
die("No SQL Result");
if(!($num = mysql_num_rows($result)))
die("No Num Rows");
$cur = 1;
echo "<BR><TABLE border='1' width='100%' cellpadding='0' cellspacing='0' bordercolor='#000000'>";
echo "<TR>";
echo "<TH width='10%'>ID</TH><TH width='10%'>Date</TH><TH width='40%'>Who To</TH><TH width='10%'>Type</TH><TH width='60'>Amount</TH><TH width='60'>VAT</TH>";
echo "</TR>";
while ($num >= $cur) {
$row = mysql_fetch_array($result);
$id = $row["Id"];
$date2 = $row["Date"];
$whoto2 = $row["WhoTo"];
$type2 = $row["Type"];
$amount2 = $row["Amount"];
$amount3 = number_format($amount2, 2);
$vat2 = $row["VAT"];
$vat3 = number_format($vat2, 2);
// Looks of outputted stuff..
echo "<TR>";
echo "<TD>$id</TD><TD>$date2</TD><TD>$whoto2</TD><TD>$type2</TD><TD width='60'>£$amount3</TD><TD width='60'>£$vat3</TD>";
echo "</TR>";
$cur++;
} ?>
<TR>
<TD colspan='3'> </TD><TD><B>Totals</B></TD>
<TD>
<?
$query = "Select SUM(Amount) as 'total' from accounts";
$result = mysql_query($query);
$real_result = mysql_result($result,0,'total');
$amount4 = number_format($real_result, 2);
echo "£<B>$amount4</B>";
?>
</TD>
<TD>
<?
$query = "Select SUM(VAT) as 'total' from accounts";
$result = mysql_query($query);
$real_result = mysql_result($result,0,'total');
$vat4 = number_format($real_result, 2);
echo "£<B>$vat4</B>";
?>
</TD>
</TR>
<?
echo "</TABLE>";
?>
</p>
<p align="center">
</p>
<p align="center"><BR>
<a href="searchform.php">Search</a> - <a href="inputform.php">Add</a> </p>
</body>
It just gives me the No SQL Result message i put up there.
But i cant figure out why its doing this.
TIA