Hello all,
I'm having a problem with my while loop pulling the information from the database. For some reason it won't diplay the information. I've run out of ideas of what it can be. I simply enter value into a form box and it goes to this page and it should pull the selected recored, but it doesn't
(Added <?php tag at start of code snippet so that the highlighting would work -- NogDog)
<?php
$var = @$_GET[['requestid'] ;
$trimmed = trim($var);
$limit=10;
if ($trimmed == "")
{
echo "<p>Invalid Link</p>";
exit;
}
if (!isset($var))
{
echo "<p>Invalid Link - Information has likely been deleted.... </p>";
exit;
}
mysql_connect("localhost","$username","$password");
mysql_select_db("$database") or die("Unable to select database");
$query = "select * from pclist where random like \"%$trimmed%\"";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < 1) {
$random=mysql_result($result,$i,"random");
$first=mysql_result($result,$i,"ln");
$last=mysql_result($result,$i,"last");
$computer=mysql_result($result,$i,"computer");
$pc=mysql_result($result,$i,"pc");
$keyboard=mysql_result($result,$i,"keyboard");
$monitor=mysql_result($result,$i,"monitor");
$pctag=mysql_result($result,$i,"pctag");
$keyboardtag=mysql_result($result,$i,"keyboardtag");
$office=mysql_result($result,$i,"office");
?>
<form action="reply.php" method="post">
<table width="523" border="0">
<tr>
<td><strong>First Name:</strong></td>
<td><label><? echo $first; ?></label> <input name="fn" type="hidden" id="fn" value="<? echo $first; ?>" /></td>
</tr>
<tr>
<td><strong>Last Name: </strong></td>
<td><label><? echo $last; ?></label><input name="ln" type="hidden" id="ln" value="<? echo $last; ?>" /></td>
</tr>
<tr>
<td><strong>Type of Internet Connection: </strong></td>
<td>
<label><? echo $computer; ?></label> <input name="computer" type="hidden" id="computer" value="<? echo $computer; ?>" />
</td></td>
</tr>
<tr>
<td><strong>PC S/N:</strong></td>
<td><label><? echo $pc; ?></label><input name="pc" type="hidden" id="pc" value="<? echo $pc; ?>" /></td></td>
</tr>
<tr>
<td><strong>Keyboard S/N:</strong></td>
<td><label><? echo $keyboard; ?></label><input name="keyboard" type="hidden" id="keyboar" value="<? echo $keyboard; ?>" /></td></td>
</tr>
<tr>
<td><strong>Monitor:</strong></td>
<td><label><? echo $monitor; ?></label><input name="monitor" type="hidden" id="monitor" value="<? echo $monitor; ?>" /></td></td>
</tr>
<tr>
<td><strong>PC Tag:</strong></td>
<td><label><? echo $pctag; ?></label><input name="pctag" type="hidden" id="pctag" value="<? echo $pctag; ?>" /></td></td>
</tr>
<tr>
<td><strong>Keyboard Tag:</strong></td>
<td><label><? echo $keyboardtag; ?></label><input name="keyboardtag" type="hidden" id="keyboardtag" value="<? echo $keyboardtag; ?>" /></td></td>
</tr>
<tr>
<td><strong>Monitor Tag:</strong></td>
<td><label><? echo $monitortag; ?></label><input name="monitortag" type="hidden" id="monitortag" value="<? echo $monitortag; ?>" /></td></td>
</tr>
<tr>
<td><strong>Comments:</strong></td>
<td><label><? echo $office; ?></label><input name="office" type="hidden" id="office" value="<? echo $office; ?>" /></td>
</tr>
</table>
<h3>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - </h3>
<h3>Business Office Input </h3>
<table width="522" border="0">
<tr>
<td width="201"><strong>Status</strong></td>
<td width="311"><table width="200">
<tr>
<td><label>
<input name="status" type="radio" value="Approved" checked="checked" />
Approved</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="status" value="See Business Office" />
See Business Office</label></td>
</tr>
</table> </td>
</tr>
<tr>
<td height="21"><strong>Business Office Comments </strong></td>
<td><label for="textarea"></label>
<textarea name="comments2" cols="49" rows="5" id="comments2"></textarea></td>
</tr>
</table>
<p><br>
<input type="Submit" value="Send">
</p>
</form>
<?
++$i;
}
?>
When I go to the page all I get is the default HTML. Any thoughts??