Jump to content

How could I print out those result from text field????.....pls help me!!!


airwinx

Recommended Posts

Hi All,
I have a code that bothering me cuople of day already, and I seriously need some one to help:
below is the page that ask user to key in their favaroute cook. I use a loop to generate out 9 textfield for each of the "awardname" category.
[code]
<table width="600" border="0" cellpadding="0" cellspacing="0" bgcolor="#E6FFE6">
<form name="form" action="aoe2007_insertnominee_r2.php" method="post">
<tr>
<td>
<table width="760" border="0" cellspacing="0" cellpadding="0">
<?
$Query="SELECT * FROM awards ORDER BY awardtype";
$Result = mysql_db_query ($DBName, $Query, $Link) or die("select: ".mysql_error());
While ($Row = mysql_fetch_array ($Result))
{
$max=9;
?>
<input type="hidden" name="awardname<? echo $Row[id];?>" id="awardname" value="<? echo $awardname;?>" >
<input type="hidden" name="awardtype<? echo $Row[id];?>" id="awardtype" value="<? echo $awardtype;?>" >
  <tr>
    <td>
<? echo $Row[awardname];?> / <? echo $Row[awardtype];?><br>
</td>
  </tr>
  <tr><td align="left" valign="middle"><?
for($i=1; $i<=$max; $i++){
echo $i;?>.&nbsp;&nbsp;<input type="text" name="nominees<? echo $i;?>" width="450">
    <br><?
}?> 
</td></tr>
<? } ?>
</table>
</td>   
</tr>
<tr><td align="center"><input type="submit" name="submit" value="Add!" class="form"></td></tr>
  </form>
</table>
[/code]
The problem is how should I print out the result like the format below:

[i]my fav chef(awardname):
1) chef1(textfield1)
2) chef2(textfield2)
3) chef3(textfield3) ....
9) chef9(textfield9)

my fav restaurant
1) rest1(textfield1)
2) rest2(textfield2)
3) rest3(textfield3) ....
9) rest9(textfield9)[/i]

I have a total of 26 categories of awardname, pls help and advise me of how to print out the result as above. I also need to store those result in mysql.

Link to comment
Share on other sites

[quote]
for($i=1; $i<=$max; $i++){
echo $i;?>.&nbsp;&nbsp;<input type="text" name="nominees<? echo $i;?>" width="450">
[/quote]

Hi, thnk for your reply, as you can see the above code, these are the text field that will let user to keyin their result and those results will need to be display. The "name="nominees<? echo $i;?>" is to identify each input of the field. Eg: nominee1= "chef1", nominee2="chef2", .....etc.

hope this will help!!!!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.