Jump to content

Archived

This topic is now archived and is closed to further replies.

airwinx

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

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.

Share this post


Link to post
Share on other sites
I'm not 100% on what you want to acheive? you seem to be pulling all data from mysql yet u want to stor eit there also? what is actualy stored in mysql and and is it you want to input?

Regards
Liam

Share this post


Link to post
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!!!!

Share this post


Link to post
Share on other sites

×

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.