Program Outputs 'Resource id3'
| From: | Guru Geek | Date: | Sat, 15 Feb 2003 08:55:08 +0000 |
| Subject: | Program Outputs 'Resource id3' | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-135635@lists.php.net to get a copy of this message | ||
Simple program that opens a txt file and reads two van numbers. Then,
for each van number, it opens a database and grabs the sum of the gross
pay column.
The problem is I get 'Resource id3' for the first van's gross pay and
'Resource id4' for the second van's gross pay.
Here's the code:
if ($viewYearEnd)
{
$readThis = ($dir."vans.txt");
$Open = fopen ($readThis, "r") or die ("Call Roger, cannot open
$readThis");
$vanList = file ($readThis);
fclose ($Open);
for ($count = 0; $count < count($vanList);$count++)
{
$run_sql_grossPay = "SELECT SUM(grossPay) FROM $usertableDaily WHERE
vanNumber=$vanList[$count]";
$grossPay = mysql_query($run_sql_grossPay);
?>
<table>
<tr>
<td align="left"><?php echo $vanList[$count]?></td>
<td align="left"><?php echo $grossPay?></td>
</tr>
</table>
<?php
}
exit;
}
Here's the output I get:
1111 Resource id #3
2222 Resource id #4
obviously van number one is 1111 and van number two is 2222.
Thanks in advance,
Roger