Jump to content

MySQL Query from echo


Bradley99

Recommended Posts

I have some code, in which I echo a form. From the form users pick different things. . .

<?
   $showevent = mysql_query("SELECT * FROM fights WHERE event='$viewevent' ORDER by id ASC");
   while($the=mysql_fetch_object($showevent)){ 
   

   
  echo "  <form action='' method='post'><tr><td class='profilerow'><input type=radio name=fighter_id value=$the->fighter1> $the->fighter1 <BR> <input type=radio name=fighter_id value=$the->fighter2> $the->fighter2 <BR> <input type=radio name=fighter_id value=1> Draw</td>
	  <td class='profilerow'><select name=method><option value=KO>Knockout</option><option value=TKO>Technical Knockout</option><option value=DEC>Decision</option></select></td>
	  <td class='profilerow'><select name=round><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option></select></td>
	  <td class='profilerow'><select name=bonus><option value=1>Yes</option><option value=2>No</option></td>	  
	  <td class='profilerow'><input type='Submit' name='Submit' value='Pick' class='Submit' /> </td></form>

   </tr>"; } ?>

 

When they choose 'Pick' for each fight, How can I, using INSERT INTO, insert the ID of that specific fight? As the fights are being echoed.

 

I have Events table, Fights table & Fighters table. Aswell as the picks table that this info gets posted to.

Link to comment
https://forums.phpfreaks.com/topic/264745-mysql-query-from-echo/
Share on other sites

Archived

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

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