what error do you get on submitting?

This page can not be displayed.

could the problem be on the first form, at the:

echo '<td><a href="phoneupdate1.php?id='.$row[0].'">Update</a></td><br/><hr>';

area? Maybe its not passing the id to the next form. Is there a way to test this?

make sure that the location in the header() redirect is correct.

could the problem be on the first form, at the:

echo '<td><a href="phoneupdate1.php?id='.$row[0].'">Update</a></td><br/><hr>';

area? Maybe its not passing the id to the next form. Is there a way to test this?

No, that is right, $row[0] refers to the column id in the database, the easy way to check, click it and see if the correct number shows up in the URL on the next page :)

http://www.elvenblade.com/test/ - that is the script I posted in my previous message, it all seems to be working there.

The header redirect is directing back to the "phoneupdate.php" file, where it should.

try changeing these <? echo $row[number]; ?> to these <?=$row[number]?> in the HTML form.

No Change

Do you have it working on your side? This is just too weird.

Well I'll be dipped. Ok, so I must have something different on my end that causes it to not work. What should I look for? Any ideas?

pass me the script you are using for updatephone.php (the first form), let me see if what you have is different than mine.

Sorry thats "phoneupdate.php". my bad.

<?php
error_reporting(E_ALL);
// Show simple format of the records so person can choose the reference name/number
// this is then passed to the next page, for all details

$host = "localhost"; 
$user = "xxx"; 
$pass = "xxx"; 
$db = "phonebook"; 

//Connecting to MYSQL
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");

//Select the database we want to use
mysql_select_db($db) or die ("Could not find database");

// Get all records in all columns from table and put it in $result.
$query = "SELECT * FROM people ORDER BY fname ASC"; 

// execute query 
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); 

// Get all records in all columns from table and put it in $result.

if (mysql_num_rows($result) > 0) {
  while($row=mysql_fetch_row($result)){
    echo "ID : $row[0] <br/>";
    echo "First Name : $row[1] <br/>";
    echo "Last Name : $row[2] <br/>";
    echo "Phone Number : $row[3] <br/>";
    echo "Extension : $row[4] <br/>";
    echo "Title : $row[5] <br/>";
    echo "Department : $row[6] <br/>";
    echo "Fax Number : $row[7] <hr>";
    // Add a link with a parameter(id) and it's value.
    echo '<a href="phoneupdate1.php?id='.$row[0].'">Update</a>';
  }
} else { 
  // no 
  // print status message 
  echo "No rows found!";
} 
//mysql_close();
?>

I just don't get it, i'm using the same exact scripts you are and I'm not getting the data in the second form. I'm lost on this one.

Ok, i figured it out. I had to turn on short tags in the php.ini file. I belive that did the trick. So now all i need to do is redo the tags and I should be good.

Xan, you are the man, thank you so much for working so hard on this, i really appreciate it, you've been a great help.

thumbs up to you.

ah ok, didn't even think about that being turned off as it is usually on by default. :)

ah ok, didn't even think about that being turned off as it is usually on by default. :)

Me neither, not sure how I came across it to begin with :) , but all is good now.

I know there are a lot of folks wanting this type of script, is there somewhere we can put it out for others to use now that it is working?

Again, thanks for all your help. Take it easy.

By chance are you able to submit a change to the data. I'm still getting a "page cannot be displayed" error after clicking submit. I've got other tasks to do for the rest of today so I'll have to get back on it on Monday. Have a great weekend.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.