<?
include("db.php");
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die("Unable to connect to database");
$query="SELECT * FROM tcg";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<center>Viewing Records</center>";
$i=0;
while ($i < $num) {
$client = mysql_result($result,$i,'ClientsName');
[B]$prgno = mysql_result($result,$i,'PrgNo'); this is line31[/B]
$prgname = mysql_result($reslt,$i,'PrgName');
$trainername = mysql_result($result,$i,'TrainerName');
$dates = mysql_result($result,$i,'Dates');
$days = mysql_result($result,$i,'Days');
$proffee = mysql_result($result,$i,'ProfFee');
$trainerfee = mysql_result($result,$i,'TrainerFee');
$reimbexp = mysql_result($result,$i,'ReimbExp');
$handoutchg = mysql_result($result,$i,'HandoutChg');
$invoiceno = mysql_result($result,$i,'InvoiceNo');
$totalinvamt = mysql_result($result,$i,'TotalInvAmt');
$feerecd = mysql_result($result,$i,'FeeRecd');
echo "$client <br> $prgno <br> $prgname <br> $trainername <br> $dates <br> $days <br> $proffee <br> $trainerfee <br> $reimbexp<br> $handoutchg <br> $invoiceno <br> $totalinvamt <br> $feerecd <br>";
$i++; }
$addition = $proffee+$trainerfee;
echo "The toal receivable amount after tds deduction is ie.(prof fee + trainer fee) ".$addition;
?>
The error says Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /www/host/folder/out.php on line 31
The problem is with only this line 31
and the rest of the code is processed without any errors.
If I put a # in front of line 31 there is no error displayed.
Please Help.