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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php