MySQL - Some Records Not Deleting

Reply

Join Date: Dec 2007
Posts: 112
Reputation: !Unreal is an unknown quantity at this point 
Solved Threads: 2
!Unreal's Avatar
!Unreal !Unreal is offline Offline
Junior Poster

MySQL - Some Records Not Deleting

 
0
  #1
Feb 22nd, 2009
Im trying to delete records. Most delete ok but some don't and Im completly lost as to why...

The information Im storing are just URLs.

Could it be to do with some irregular characters within these URLs?

Is there a recomended way to store a URL?

Please help me out. Its quite a major flaw in my script

I think it probably is the irregular characters.

Here are the records which wont delete

  1. http://www.theflickzone.com/showthread.php?p=24961#post24961
  2. http://www.theflickzone.com/tags.php?tag=Google+Video
  3. http://www.theflickzone.com/showthread.php?p=25067#post25067
  4. http://www.theflickzone.com/member.php?find=lastposter&f=34
  5. http://www.theflickzone.com/member.php?find=lastposter&f=31
Well there are just some. There are many more.

Thanks
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 524
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro

Re: MySQL - Some Records Not Deleting

 
0
  #2
Feb 22nd, 2009
What error is returned?
Add or die(mysql_error()); to the closing bracket of the query as so:
  1. mysql_query("....")or die(mysql_error());
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 112
Reputation: !Unreal is an unknown quantity at this point 
Solved Threads: 2
!Unreal's Avatar
!Unreal !Unreal is offline Offline
Junior Poster

Re: MySQL - Some Records Not Deleting

 
0
  #3
Feb 22nd, 2009
There isn't one

EDIT: Just for a bit of context...

  1. <?php
  2. include('includes/config.php');
  3. $referer = $_SERVER['HTTP_REFERER'];
  4. $addtolist = $_GET['add'];
  5. mysql_query("DELETE FROM spider WHERE url='$addtolist'")or die(mysql_error());
  6. header("Location: $referer");
  7. mysql_close($con);
  8. ?>
Last edited by !Unreal; Feb 22nd, 2009 at 10:17 pm.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 524
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro

Re: MySQL - Some Records Not Deleting

 
1
  #4
Feb 22nd, 2009
Have you tried echoing $addtolist to make sure that it contains the value expected?
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 112
Reputation: !Unreal is an unknown quantity at this point 
Solved Threads: 2
!Unreal's Avatar
!Unreal !Unreal is offline Offline
Junior Poster

Re: MySQL - Some Records Not Deleting

 
0
  #5
Feb 23rd, 2009
Yeah. Im expecting to get these characters. I just need to know how to handle them.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 112
Reputation: !Unreal is an unknown quantity at this point 
Solved Threads: 2
!Unreal's Avatar
!Unreal !Unreal is offline Offline
Junior Poster

Re: MySQL - Some Records Not Deleting

 
0
  #6
Feb 23rd, 2009
I managed to work this one out.

You have to work with the URLs in an encoded form. Using rawurlencode and rawurldecode.

Thanks for your help though
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC