yeah, that's what i thought, but then when i tried to run the code & selected an item from a drop down list i got the following message...
Warning: Missing argument 1 for cat_query() in c:\apache\htdocs\cat_query.inc on line 3
Warning: Missing argument 2 for cat_query() in c:\apache\htdocs\cat_query.inc on line 3
Warning: Missing argument 3 for cat_query() in c:\apache\htdocs\cat_query.inc on line 3
Warning: Missing argument 4 for cat_query() in c:\apache\htdocs\cat_query.inc on line 3
Warning: Missing argument 5 for cat_query() in c:\apache\htdocs\cat_query.inc on line 3
Warning: Missing argument 6 for cat_query() in c:\apache\htdocs\cat_query.inc on line 3
Warning: Missing argument 7 for cat_query() in c:\apache\htdocs\cat_query.inc on line 3
cat_query is the include file that contains the function. line 3 is where the function code begins. the whole cat_query code:
<?php
function cat_query ($g_viewc_query,$g_viewc_result,$num,$CatId,$CatName,$bg,$row){
//Make the query
$g_viewc_query = "SELECT GameTitle, PubId, MaxNumPlay, GameCube, PS2, Xbox FROM Game WHERE CatId=$CatId ORDER BY GameTitle ASC";
//Run the query
$g_viewc_result = @ ($g_viewc_query);
//How many records exist?
$num = mysql_num_rows ($g_viewc_result);
if ($num > 0) { //If it ran ok, display the records.
echo "<p><big><b>There are currently $num games under the category $CatName in the database.</b></big></p>";
//Table header
echo '<table align="left" cellspacing="2" cellpadding="2">
<tr>
<td align="left"><b>Game Title</b></td>
<td align="left"><b>Publisher</b></td>
<td align="left"><b>No. Of Players</b></td>
<td align="left"><b>GameCube</b></td>
<td align="left"><b>PlayStation 2</b></td>
<td align="left"><b>Xbox</b></td></tr>';
//Fetch and print all the records.
$bg = '#eeeeee'; //Set the background color.
while ($row = mysql_fetch_array($g_viewc_result, MYSQL_NUM)) {
$bg = ($bg == '#eeeeee' ? '#ffffff' : '#eeeeee'); //Switch the background color.
echo '<tr bgcolor="', $bg, '"><td align="left">', $row[0], '</td>
<td align="left">', $row[1], '</td>
<td align="left">', $row[2], '</td>
<td align="left">', $row[3], '</td>
<td align="left">', $row[4], '</td>
<td align="left">', $row[5], '</td>
</tr>';
}
echo '</table>';
mysql_free_result ($g_viewc_result); //Free up the resources.
}else { //If it did not run Ok.
echo '<p>The games could not be displayed due to a system error.</p><p>' . mysql_error() . '</p>';
}
mysql_close(); //Close the database connection.
}
?>[/color]