dbdummy Posted August 30, 2007 Share Posted August 30, 2007 i have a row in a table that contains 3 columns of information to an event. if they want to add another event (row), i somehow want (perhaps a 4th column that has a button, add another event. and then that whole row would repeat itself in the table. <tr> <td>Event</td> <td> <select name="event" id="event"> <option selected="selected">Select Event Type</option> <?php do { echo "<option value=\"".$row_event['eventId']"". if ($row_event['eventId'] == $row_eventName['eventName']){ echo "selected=\"selected\"". ">".$row_event['eventName'];."</option>"; } while ($row_event = mysql_fetch_assoc($event)); ?> </select> </td> <td><select name="event" id="event" multiple size="4"> <option selected="selected">Select Date(s)</option><?php $date = mktime(0,0,0); for ($i=0; $i<90; $i++) { $d1 = date('Y-m-d', $date); $d2 = date('M d Y', $date); echo "<option value='$d1'>$d2</option>\n"; $date = strtotime('+1 days', $date); } ?> </select> </td> </tr> Quote Link to comment https://forums.phpfreaks.com/topic/67276-add-a-row-to-a-table-if-more-information-is-wanted/ Share on other sites More sharing options...
trq Posted August 30, 2007 Share Posted August 30, 2007 Are you talking about html rows and tables? Or database rows / tables? Quote Link to comment https://forums.phpfreaks.com/topic/67276-add-a-row-to-a-table-if-more-information-is-wanted/#findComment-337507 Share on other sites More sharing options...
Fadion Posted August 30, 2007 Share Posted August 30, 2007 There isnt a question there!! If u want to add a row from a button press, make a form with the data to be inputed and a submit button. Send those data with post and: if(isset($_POST['variable']){ $var1 = mysql_real_escape_string($_POST['var1']); $var2 = mysql_real_escape_string($_POST['var2']); $query = @mysql_query("INSERT INTO table (col1, col2) VALUES ('$var1', '$var2')") or die(mysql_error()); echo "Your data were added."; } If this is what u mean anyway. Quote Link to comment https://forums.phpfreaks.com/topic/67276-add-a-row-to-a-table-if-more-information-is-wanted/#findComment-337510 Share on other sites More sharing options...
Fadion Posted August 30, 2007 Share Posted August 30, 2007 Are you talking about html rows and tables? Or database rows / tables? lol, yeah maybe he's talking about html tables. Didnt think of that ??? Quote Link to comment https://forums.phpfreaks.com/topic/67276-add-a-row-to-a-table-if-more-information-is-wanted/#findComment-337512 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.