Jump to content

check duplicate


fer0an

Recommended Posts

Something like this i guess.

 

$title = 'blahblah';

/*leave out the * in yourtablename*/
$query = "SELECT * FROM *yourtablename* WHERE title = '$title'";
$result = mysql_query($query);

if(mysql_num_rows($result) == 0)
{
$query = "INSERT INTO *yourtablename* (id,title,introtext,fulltext,link) VALUES (NULL,Titleblahblah,fulltextblahblah,linkblahblah)";
$result = mysql_query($query);

if(!result)
{
die("problem inserting data: ".mysql_error());
}
}

Link to comment
https://forums.phpfreaks.com/topic/189685-check-duplicate/#findComment-1001096
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.