I am trying to code where if there is the same data in the mysql table as the on you are about to insert, then do nothing, but when if there isn't then insert into the table.
This is my code so far:
for($i=0;$i<count($TitleArray);$i++){
$sql = "SELECT * FROM ytable WHERE Title *LIKE the one I am about to insert"
if (Data about to insert already exists in table){
"do nothing";
}*
else{
$sql = "INSERT INTO ytable (Title, Pubdate, Link, Tweeted, Created)
VALUES ('$TitleArray[$i]', '$PubdateArray[$i]', '$LinkArray[$i]', NULL, $created)";
mysql_query($sql,$db_con);
}
I need help writing the code from the first * to the next *. Please help