troubleshooting Question

Populating 2 php pages from a MySQL table and updating the table by the ID no

Avatar of blaadom
blaadom asked on
PHP
19 Comments2 Solutions203 ViewsLast Modified:
I have 2 php pages at the moment which add a new field in a MySQL db table. The first page has data, this data is passed to page2 with session variables and then all the data gets entered in to the table.

I want to do an update to that table going by the ID no. selected.

On my first page, I have the following code that selects the "IO" no from the table (IO is primary key and is autoincremented):

<?php
require("connect.php");

$sql = "SELECT IO FROM bebo";
$result = mysql_query($sql) or die(mysql_error());
echo "<form action='io_bebo_edit_page2.php' name='myform'>";
echo "<select name='IO' onChange='submit()'>";
echo "<option value=''>Select IO No</option>";
while ($row = mysql_fetch_assoc($result)) {
echo "<option value='{$row['IO']}'>{$row['IO']}</option>";
}
echo "</select>";
echo "</form>";
?>

I want to be able to populate all the fields in page2 when I select the "IO" no, and then populate all the fileds on page3 as well when i click next.
When I go on to page2, I want to be able to change / edit any info and carry that accross to page3. And the same for page3, i want to edit anything and then udate the table according to the "IO" no.

At the moment I'm stuck after selecting the IO no on page1 and going on to page2
ASKER CERTIFIED SOLUTION
Vel EousResearch & Development Manager

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 19 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 19 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros