airwinx Posted July 17, 2006 Share Posted July 17, 2006 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;?>. <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 restaurant1) 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. Quote Link to comment Share on other sites More sharing options...
shocker-z Posted July 17, 2006 Share Posted July 17, 2006 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?RegardsLiam Quote Link to comment Share on other sites More sharing options...
airwinx Posted July 17, 2006 Author Share Posted July 17, 2006 [quote]for($i=1; $i<=$max; $i++){ echo $i;?>. <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!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.