MySQL Forums
Forum List  »  PHP

Add to Row
Posted by: Julia Fleur
Date: March 04, 2010 10:05PM

I created a drop down menu for a table called 'students' with an index. How can I apply the same name i selected from table 'students' (in the drop-down menu) to another table called 'data' in a form?

For instance in the drop-down menu, I selected the name 'John Smith' which is stored in a table called 'students'

How can i apply 'John Smith' to a row in another table called 'data'?


<?php

$result = mysql_query("SELECT name FROM students");

echo '<p><label for="name">Student Name:</label> <select name="name" id="name">';

while($row = mysql_fetch_array($result)) { ?>

<option value="<?php echo $row['name_id']; ?>"><?php echo $row['name']; ?></option>

<?php
}
?>

Options: ReplyQuote


Subject
Written By
Posted
Add to Row
March 04, 2010 10:05PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.