Jump to content


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

  • Please log in to reply
2 replies to this topic

#1 airwinx

  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 17 July 2006 - 11:39 AM

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.
<table width="600" border="0" cellpadding="0" cellspacing="0" bgcolor="#E6FFE6">
<form name="form" action="aoe2007_insertnominee_r2.php" method="post">
<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))
<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;?>" >
	<? echo $Row[awardname];?> / <? echo $Row[awardtype];?><br>
  	<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">
<? } ?>
	<tr><td align="center"><input type="submit" name="submit" value="Add!" class="form"></td></tr>
The problem is how should I print out the result like the format below:

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 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.

#2 shocker-z

  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 17 July 2006 - 11:53 AM

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?

www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 airwinx

  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 17 July 2006 - 12:27 PM

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

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!!!!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users