02-03-2010, 10:18 AM
(02-02-2010, 10:56 PM)Master of The Universe Wrote: Open the file, list.php and find this line;
PHP Code:echo "<td><a href=\"t.php?edit={$row['id']}\">Edit</a> | <a href=\"t.php?del={$row['id']}\">Delete</a>";
Then replace that line with this one;
PHP Code:echo "<td><a href=\"coin.php?edit={$row['id']}\">Edit</a> | <a href=\"coin.php?del={$row['id']}\">Delete</a>";
Sorry I forgot to change the href...
script is working fine so far. wanted to ask. anyways to make it so when I edit/delete a line, it'll refresh the page? currently, once I do either of the 2, I have to backspace out the url to get back to the /coin.php file.
also, I added another field to the database (I ran the query to add it and added it in the files and etc, but where in this section would I add it?
Code:
$edit_id = (int) $_POST['id'];
$sql = "UPDATE `coin_info` SET `date` = '{$_POST['date']}',";
$sql .= "`price` = '{$_POST['price']}',`condition` = '{$_POST['condition']}',`year` = '{$_POST['year']}',";
$sql .= "`silver` = '{$_POST['silver']}',`gold` = '{$_POST['gold']}',`weight` = '{$_POST['weight']}' ";
$sql .= "WHERE `id` = '{$edit_id}' LIMIT 1 ;";