Displaying data from a db so it can be edited and updated

Codes here !

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 2
Joined: Thu Nov 07, 2002 9:10 pm
Location: australia

Displaying data from a db so it can be edited and updated

Postby phantom_turtle » Thu Nov 07, 2002 9:40 pm

I have been programming in c++ for a while now and I have decided to have a go at PHP. I am just starting so this may seem a silly question.I am familiar with the method of displaying records from a sql database in a table. My problem is that I want to be able to display the data and at the same time be able to edit it and update it back into the database.

For example:
Say I requested all the records from a table in my db and and displayed them in a table:

| john | smith | 5555-5555 | 123 somewhere|

What i want to be able to do is display the data above in a way that i can change john smiths phone number and update it back to the database.

If some one could post a bit of sample code on how to do it it would be a huge help.



Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Sat Nov 09, 2002 5:40 am

try to diplay values in the form
like this
echo"<form action=update.php method=post>";
echo "<input type=text name=id value='$data['id']'>";
echo "<input type=submit value='send'> </form>";

update.php will be update your db and reload in edit page wgere are you starting...

Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 1 guest