search/results display help
Posted: Fri Apr 09, 2004 10:06 pm
I am trying to make a simple search of my database. I believe I have the html page sending the form info to the php page, but I don't think the php page is reading it correctly. The form name on the html page is named "moneyinput" and the input is supposed to be a Salary of a Player. In DW, I am making a recordset13 on the php page and filtering with a Form Variable using "moneyinput" and less than(<) with Salary in descending order. It shows up when I run a test in the Recordset Dialog box. I then Insert a Dynamic Table, which lays out a two row table with the names of the categories on top and the dynamic text on he bottom (Recordset13.Player...etc), and all of this has a repeat region. My first 10 attempts resulted in a table with the categories and empty recordsets. My last three have given me an error in addition to that table. The error is:
Warning: 2 is not a valid MySQL result resource in /home/slacker/saltrivergraphics.com/bal/moneyresult.php on line 37
Line 37 is the While statement. I don't think this is the source of my problem since I also have the blank table, but it obviously not good. The third line looks suspect to me. How could that recordset = "1"?
As far as I can tell my problem lies in how I'm trying to DISPLAY the info, since the DW test works. Should the dynamic text on the bottom of the table be reffering to something else, maybe something having to do with the original form from the html page? I would think that would be included in the recordset, but I would think I wouldn't need 13 versions to get it wrong.
Please help.
Salt River Graphics
Warning: 2 is not a valid MySQL result resource in /home/slacker/saltrivergraphics.com/bal/moneyresult.php on line 37
Line 37 is the While statement. I don't think this is the source of my problem since I also have the blank table, but it obviously not good. The third line looks suspect to me. How could that recordset = "1"?
As far as I can tell my problem lies in how I'm trying to DISPLAY the info, since the DW test works. Should the dynamic text on the bottom of the table be reffering to something else, maybe something having to do with the original form from the html page? I would think that would be included in the recordset, but I would think I wouldn't need 13 versions to get it wrong.
Please help.
Salt River Graphics
Code: Select all
<?php require_once('../Connections/slacker_roster_duff.php'); ?>
<?php
$colname_Recordset13 = "1";
if (isset($HTTP_POST_VARSї'moneyinput'])) {
$colname_Recordset13 = (get_magic_quotes_gpc()) ? $HTTP_POST_VARSї'moneyinput'] : addslashes($HTTP_POST_VARSї'moneyinput']);
}
mysql_select_db($database_slacker_roster_duff, $slacker_roster_duff);
$query_Recordset13 = sprintf("SELECT * FROM bal_teams WHERE Salary < %s ORDER BY Salary DESC", $colname_Recordset13);
$Recordset13 = mysql_query($query_Recordset13, $slacker_roster_duff) or die(mysql_error());
$row_Recordset13 = mysql_fetch_assoc($Recordset13);
$totalRows_Recordset13 = mysql_num_rows($Recordset13);
mysql_free_result($Recordset13);
?>
<table border="1" cellpadding="2" cellspacing="2">
<tr>
<td>Player</td>
<td>Team</td>
<td>Salary</td>
<td>Eligible</td>
<td>Postion</td>
<td>POS#</td>
<td>Contract</td>
<td>Owner</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset13ї'Player']; ?></td>
<td><?php echo $row_Recordset13ї'Team']; ?></td>
<td><?php echo $row_Recordset13ї'Salary']; ?></td>
<td><?php echo $row_Recordset13ї'Eligible']; ?></td>
<td><?php echo $row_Recordset13ї'Postion']; ?></td>
<td><?php echo $row_Recordset13ї'POS#']; ?></td>
<td><?php echo $row_Recordset13ї'Contract']; ?></td>
<td><?php echo $row_Recordset13ї'Owner']; ?></td>
</tr>
<?php } while ($row_Recordset13 = mysql_fetch_assoc($Recordset13)); ?>
</table>