I am lost now!
I get this error!
Date Selection Points Price Profit/Loss Accumulative Balance
2000
3/11/2005 Nag 1 4 33.33
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in c:\inetpub\wwwroot\bettinghistory\index.php on line 73
Notice: Undefined variable: gtotal in c:\inetpub\wwwroot\bettinghistory\index.php on line 77
1/11/2005 Neddy 1.5 5 37.50
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in c:\inetpub\wwwroot\bettinghistory\index.php on line 73
Notice: Undefined variable: gtotal in c:\inetpub\wwwroot\bettinghistory\index.php on line 77
heres my code......
<?php require_once('configinc.php'); ?>
<?php
$maxRows_bettinghistory = 100;
$pageNum_bettinghistory = 0;
if (isset($GET['pageNum_bettinghistory'])) {
$pageNum_bettinghistory = $GET['pageNum_bettinghistory'];
}
$startRow_bettinghistory = $pageNum_bettinghistory * $maxRows_bettinghistory;
mysql_select_db($database_bettinghistory, $bettinghistory);
$query_bettinghistory = "SELECT * FROM bettinghistory ORDER BY id DESC";
$query_limit_bettinghistory = sprintf("%s LIMIT %d, %d", $query_bettinghistory, $startRow_bettinghistory, $maxRows_bettinghistory);
$bettinghistory = mysql_query($query_limit_bettinghistory, $bettinghistory) or die(mysql_error());
$row_bettinghistory = mysql_fetch_assoc($bettinghistory);
if (isset($GET['totalRows_bettinghistory'])) {
$totalRows_bettinghistory = $GET['totalRows_bettinghistory'];
} else {
$all_bettinghistory = mysql_query($query_bettinghistory);
$totalRows_bettinghistory = mysql_num_rows($all_bettinghistory);
}
$totalPages_bettinghistory = ceil($totalRows_bettinghistory/$maxRows_bettinghistory)-1;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="5">
<tr>
<td width="64">Date</td>
<td width="106">Selection</td>
<td width="64">Points</td>
<td width="64">Price</td>
<td width="64">Profit/Loss</td>
<td width="84">Accumulative</td>
<td width="64">Balance</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td align="right">2000</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_bettinghistory['date']; ?></td>
<td><?php echo $row_bettinghistory['selection']; ?></td>
<td align="right"><?php echo $row_bettinghistory['points']; ?></td>
<td align="right"><?php echo $row_bettinghistory['price']; ?></td>
<td align="right"><?php echo $row_bettinghistory['profitloss']; ?></td>
<td align="right">
<?php
$query=mysql_query("SELECT * FROM profitloss");
while ($obj=mysql_fetch_object($query)) {
$gtotal+=$obj->profitloss;
}
echo $gtotal;
?>
</td>
<td align="right"> </td>
</tr>
<?php } while ($row_bettinghistory = mysql_fetch_assoc($bettinghistory)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($bettinghistory);
?>
please help some one and thanks so far!