General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old April 16th, 2003, 10:28 PM
Decoy Decoy is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 28 Decoy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
deleting links from db not working after upgrade

After updating from version 4.0 to 4.2 I have encountered a number of problems, all which stem from having globals ON. I've been able to go through and fix just about everything except for when it comes to deleting links from the database.

This is the snippet that displays the links with the respective 'edit' and 'delete' links
PHP Code:
while($myrow mysql_fetch_array($result))

  
$linkname $myrow["name"]; 
  
$linkid $myrow["linkid"]; 
  echo 
$linkname'<br>'
  echo 
"<a href=\"update.php?linkid=$linkid\" class=mediumbold>Edit</a><br>"
  echo 
"<a href=\"admin.php?linkid=$linkid&task=delete_link\" class=mediumbold>Delete</a><br>"

The last line which calls admin.php is actually admin.php itself. I didn't know how to pass a variable using php self.
Here is the code in admin.php...
PHP Code:
if($task == 'delete_link')  

  
$sql "DELETE FROM links WHERE linkid = $linkid";
  
$result mysql_query($sql); 
  if(!
$result)
  {
    echo(
"ERROR: " mysql_error() . "\n$sql\n");
    exit();
  }    


I cannot get it to delete for anything. When I hit 'submit', the form just reloads.

Thamks for any input

Reply With Quote
  #2  
Old April 22nd, 2003, 01:15 AM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to avit
Re: deleting links from db not working after upgrade

Quote:
PHP Code:
if($task == 'delete_link')  

  ...




Could it be:

PHP Code:
if ($_GET['task'] == 'delete_link')
{
  ...


Reply With Quote
  #3  
Old April 22nd, 2003, 12:15 PM
Decoy Decoy is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 28 Decoy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hey Avit,

Yeah, that was it. I walked away from the code for awhile, and when I came back it jumped right out at me

Thanks for the reply

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > deleting links from db not working after upgrade


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway