Been very frustrating but mysql is returning an empty set for this code (not echoing exists) :
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("repository", $con);
$url = stripslashes($url);
$url = mysql_real_escape_string($url, $con);
$exists = mysql_query("SELECT url FROM sites WHERE url = '$url' LIMIT 1");
if (mysql_num_rows($exists) == 1) {
echo "exists";
}
it should not be doing this because I've tested a good amount.
The table consists of one column "url", it is datatype varchar(1000) (the maximum). the url stored for test purposes is http://en.wikipedia.org/wiki/Thailand
$urljust before you fire your query and confirm that it looks like the data in your database?mysql_num_rows($exists)returns? 3. Show us the exact query that is generated by your code.