I currently use this query to update listings in my database from my php app:
$query = "INSERT INTO listings (title, description) VALUES ('$title','$description')";
This listings table has a 'postid' column as it's primary key that auto increments.
I don't want to do an INSERT IGNORE and have it check postid. Instead, I'd like to keep the table structure the same and check to see if $title exists.. and not insert if it does.
Will php/mysql allow me to somehow run a:
If ($title does not exist) {
$query = "INSERT INTO listings (title, description) VALUES ('$title','$description')";
}
If so, how would I write that?
Thanks for any suggestions.