Can somebody please explain to me in simple beginners terms how I can submit a form with more than one value for each variable to my database?
$tarifid and $tarifname can have multiple values which I am using to generate the table, and I need to insert corresponding values for 'pitch' and 'adult' entered by the user to the database, and want to do it with one submit button, one form if possible without getting too complicated.
Code PHP:echo "<form action='updatecampingpricelist.php' method='get' name='FormName'>"; echo "<table width='100%' border='1' cellspacing='2' cellpadding='0'>"; echo "<tr><td>Tarif id</td>"; echo "<td>Tarif name</td>"; echo "<td>Pitch</td>"; echo "<td>Adult</td></tr>"; $sql = @mysql_query("select tarifid, tarifname from campingtarif"); while ($campingtarif = mysql_fetch_array($sql)) { $tarifid = $campingtarif['tarifid']; $tarifname = $campingtarif['tarifname']; echo "<tr valign = 'center'>\n"; echo "<td align = 'center'>" . $tarifid . "</td>\n"; echo "<td align = 'center'>" . $tarifname . "</td>\n"; echo "<td align = 'center'>£<input type='text' name='pitch'></td>\n"; echo "<td align = 'center'>£<input type='text' name='adult'></td>\n"; } echo "</table>"; echo "<p><input type='submit' value='submit'></p>"; echo '</form>';





Bookmarks