View Single Post
  #2 (permalink)  
Old 11-30-04, 02:25 PM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
If you have the code to list the products then do that in the updateproducts.php and set the retrieved values as variables!

So if you have 'link.php?id=1' then to edit it go to 'edit.php?id=1' and use:

PHP Code:

<?php


//connect to db

$query "SELECT item, name, description FROM table WHERE id='$_GET[id]'";
$result mysql_query($query) or die(mysql_error());
while(
$rmysql_fetch_array($result)) {
$item $r['item'];
$name $r['name'];
$description $r['description'];
}

?>
Then have a form:

PHP Code:

Item: <input type="text" name="item" value="<? echo $item?>">


//etc..
And just add the values in the db (will overwrite the old ones)!
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote