943,721 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 592
  • PHP RSS
Feb 22nd, 2009
0

MySQL - Some Records Not Deleting

Expand Post »
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

PHP Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 11
Solved Threads: 2
Junior Poster
!Unreal is offline Offline
112 posts
since Dec 2007
Feb 22nd, 2009
0

Re: MySQL - Some Records Not Deleting

What error is returned?
Add or die(mysql_error()); to the closing bracket of the query as so:
php Syntax (Toggle Plain Text)
  1. mysql_query("....")or die(mysql_error());
Reputation Points: 96
Solved Threads: 124
Master Poster
Will Gresham is offline Offline
728 posts
since May 2008
Feb 22nd, 2009
0

Re: MySQL - Some Records Not Deleting

There isn't one

EDIT: Just for a bit of context...

php Syntax (Toggle Plain Text)
  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.
Reputation Points: 11
Solved Threads: 2
Junior Poster
!Unreal is offline Offline
112 posts
since Dec 2007
Feb 22nd, 2009
1

Re: MySQL - Some Records Not Deleting

Have you tried echoing $addtolist to make sure that it contains the value expected?
Reputation Points: 96
Solved Threads: 124
Master Poster
Will Gresham is offline Offline
728 posts
since May 2008
Feb 23rd, 2009
0

Re: MySQL - Some Records Not Deleting

Yeah. Im expecting to get these characters. I just need to know how to handle them.
Reputation Points: 11
Solved Threads: 2
Junior Poster
!Unreal is offline Offline
112 posts
since Dec 2007
Feb 23rd, 2009
0

Re: MySQL - Some Records Not Deleting

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
Reputation Points: 11
Solved Threads: 2
Junior Poster
!Unreal is offline Offline
112 posts
since Dec 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Disallow Multiple of the Same Usernames
Next Thread in PHP Forum Timeline: storing the selected value of a drop-down list





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC