hi, im trying to compare the string from my new $_POST['title'] and in my database. If my new post is the same in database, it must notify it is the same. I am trying to use strcmp if it is better. Or maybe anyone has better or simpler code.
$newtitle = $_POST['title'];
/* COMPARE TITLE */
$resultdbtitle = mysql_query("SELECT * FROM table WHERE title = {$newtitle}");
while($titledbinfo = mysql_fetch_array($resultdbtitle)){
$titledb = $titledbinfo['newtitle'];
}
$checktitle = strcmp($vtitle,$titledb);
if ($checktitle == 0){
echo "THE SAME, PLEASE USE ANOTHER TITLE";
} else {
echo "NOT THE SAME";
}