Well I have not the answer!
I change my sentence, bacause I want print the sql, then now I'm using
$title2= htmlspecialchars($title);
$sql ="SELECT * FROM Comercials WHERE cTitle='$title2'";
echo "sql ",$sql,"<br>";
echo "title2 ",$title2,"<br>";
echo "title ",$title,"<br>";
//$row = mysql_fetch_array($sql);
$temp = "".$row["cTitle"]."";
if ($temp == $title2) {
echo "that Comercial Name: <B>".$title."</B> is already taken -go back and chose another one.";
}
insert
}
It don't work!
then I try:
$title3= mysql_escape_string($title);
$sql ="SELECT * FROM Comercials WHERE cTitle='$title3'";
echo "sql ",$sql,"<br>";
echo "title3 ",$title3,"<br>";
echo "title ",$title,"<br>";
//$row = mysql_fetch_array($sql);
$temp = "".$row["cTitle"]."";
if ($temp == $title3) {
echo "that Comercial Name: <B>".$title."</B> is already taken -go back and chose another one.";
}
insert
}
But it don't work.
The print is:
sql SELECT * FROM Comercials WHERE cTitle='She\\'s thing'
title2 She\'s thing
title3 She\\'s thing
title She\'s thing
Somebody know how to made that.
I don't want my clients can put two equal titles.
But wen they put things with ' my sentence don't work.
Things like she's house can put in my db any times, and I won't that.
Help please!
😕 😕 😕
note: My server has Magic quotes =On