Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
php script
#13
(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 ;";
Reply


Messages In This Thread
php script - by andrewjs18 - 02-02-2010, 02:08 PM
RE: php script - by Gaijin - 02-02-2010, 02:10 PM
RE: php script - by andrewjs18 - 02-02-2010, 02:24 PM
RE: php script - by Gaijin - 02-02-2010, 02:30 PM
RE: php script - by andrewjs18 - 02-02-2010, 02:33 PM
RE: php script - by Gaijin - 02-02-2010, 05:36 PM
RE: php script - by andrewjs18 - 02-02-2010, 10:34 PM
RE: php script - by TheLifelessOne - 02-02-2010, 06:11 PM
RE: php script - by Gaijin - 02-02-2010, 06:14 PM
RE: php script - by Gaijin - 02-02-2010, 10:44 PM
RE: php script - by andrewjs18 - 02-02-2010, 10:51 PM
RE: php script - by Gaijin - 02-02-2010, 10:56 PM
RE: php script - by andrewjs18 - 02-03-2010, 10:18 AM
RE: php script - by Gaijin - 02-03-2010, 12:30 PM
RE: php script - by andrewjs18 - 02-03-2010, 11:35 PM
RE: php script - by Gaijin - 02-04-2010, 05:46 AM
RE: php script - by andrewjs18 - 02-04-2010, 01:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PHP Framework List: An Ultimate Guide to 102 PHP Frameworks for Web Developers tk-hassan 0 815 07-27-2020, 11:26 PM
Last Post: tk-hassan
  Req. Upload PHP script. 3 X P L 0 I T 1 1,237 07-14-2012, 05:19 PM
Last Post: 'Snorlax
  PHP Video Tutorials (PHP For Beginners) Eleqtriq 4 3,343 10-10-2011, 01:00 PM
Last Post: Greyersting
  optimize mysql through a php script andrewjs18 7 2,908 10-05-2011, 06:31 PM
Last Post: John.
  Creating a simple PHP/MySQL login script ndee 16 9,665 05-14-2011, 02:18 AM
Last Post: モrainee

Forum Jump:


Users browsing this thread: 1 Guest(s)