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

http://www.theflickzone.com/showthread.php?p=24961#post24961
http://www.theflickzone.com/tags.php?tag=Google+Video
http://www.theflickzone.com/showthread.php?p=25067#post25067
http://www.theflickzone.com/member.php?find=lastposter&f=34
http://www.theflickzone.com/member.php?find=lastposter&f=31

Well there are just some. There are many more.

Thanks :)

Recommended Answers

All 5 Replies

What error is returned?
Add or die(mysql_error()); to the closing bracket of the query as so:

mysql_query("....")or die(mysql_error());

There isn't one :(

EDIT: Just for a bit of context...

<?php
include('includes/config.php');
$referer = $_SERVER['HTTP_REFERER'];
$addtolist = $_GET['add'];
mysql_query("DELETE FROM spider WHERE url='$addtolist'")or die(mysql_error());
header("Location: $referer");
mysql_close($con);
?>

Have you tried echoing $addtolist to make sure that it contains the value expected?

commented: Thanks for your help - !Unreal +2

Yeah. Im expecting to get these characters. I just need to know how to handle them.

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 :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.