MySQL Forums
Forum List  »  PHP

Re: Only can display first row of tables to a form
Posted by: Douglas Moxley
Date: September 07, 2017 07:55AM

Peter,

Thank you again for your great answer which leaves me to believe my entire problem is based on my table entries. I have 20 table entries for things like first_name, last_name, date_of_birth, etc,. I thought I could use the same index, i.e, first_name, for each employee? I'm hoping I don't need to assign a table entry for each employee like first_name1, first_name2, first_name3, etc, for roughly 100 employees. That would be 2,000 table entries. If that's not the case then I cannot explain the below results. My <form> entries and correct per the W3 website.

Thank you again!
Doug


When I do this string: $row=mysqli_fetch_array($result);
I get this result:

first name: John last name: Doe
__________ __________
| John | | Doe |
----------- ----------
__________ __________
| John | | Doe |
----------- ----------

When I do this string: while($row=mysqli_fetch_array($result)) {.....}
I get this result:

first name: John last name: Doe
first name: Bob last name: Smith
__________ __________
| | | |
---------- ----------
__________ __________
| | | |
---------- ----------


<form action="test.php" method="get" enctype="multipart/form-data" multiple="multiple">
<input type="text" name="first_name" value= "<?php echo $row['first_name']; ?> ">
<input type="text" name="last_name" value= "<?php echo $row['last_name']; ?> "><br />
<input type="text" name="first_name" value= "<?php echo $row['first_name']; ?> ">
<input type="text" name="last_name" value= "<?php echo $row['last_name']; ?> "><br />
</form>

Options: ReplyQuote


Subject
Written By
Posted
Re: Only can display first row of tables to a form
September 07, 2017 07:55AM


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.