Create a form for editing the record
Then on the display funtion just put a link on each record to that form
and pass the id of that record like <a
On the edit form just grab the data of the $id passed on the url and put
those values on the input fields like <input type="text" name="field1"
Than just save the form result into the database with an UPDATE
tablename SET filed1='$field1' ... WHERE id='$id'); ...

Dont' forget the bit of code here are just examples and very insecure
Need to work on the validation etc... 
Humberto Silva
World Editing

-----Original Message-----
From: Louie Miranda [mailto:[EMAIL PROTECTED] 
Sent: quinta-feira, 15 de Janeiro de 2004 8:00
Subject: [PHP-DB] sql query, editing?

I have this code below, it fetches data on a mysql database. I was
hoping you could give me a code hint on where could, my goal is to
display this data on a browser which i did already and be able to edit
it via a form.

edit? -> table1=value -> table2=value

I dont know where to start. please help me, i hope i can display all the
data and have a button for editing and catch which one to edit.

## code ##
$result = mysql_query("select
product_code,title,language,issue,category,cost from iip_t_cp where
issue = $issue and category = '$category' and language = '$language' and
depleted = '$depleted'", $connect); $num_rows = mysql_num_rows($result);

function display($result)
    echo "<h1>pricelist records</h1>\n";
    echo "<br>";
    echo "\n<table cellspacing=3 cellpadding=3 border=1>\n<tr>\n" .
ost</th>" .

      while ($row = @ mysql_fetch_row($result))
          echo "\n<tr>";
          foreach($row as $data)
          echo "\n\t<td> $data </td>";
          echo "\n</tr>";

    echo "\n</table>";
## code ##

-- -
Louie Miranda

PHP Database Mailing List (
To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to