MySQL Forums
Forum List  »  PHP

mysqli insert into table only if not exists
Posted by: jaspreet singh
Date: August 13, 2017 12:52AM

I need to insert a record into a database table only if title field doesn't match one that already exists in the DB.

include ('common/connection.php');

$query="update namedb set
title='$title',comment='$com' where id=$id";
$query="INSERT INTO namedb (title,comment) values


Options: ReplyQuote

Written By
mysqli insert into table only if not exists
August 13, 2017 12:52AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.