How can I club this two queries into one? Insert a record if a record does not exist in another table. I tried googling but I have only found solutions using joins, not in but here I guess there is no relation between this two tables. can I still insert into it with a single query
$res = mysqli_query($con,"SELECT 1 FROM bicds WHERE (bid = $pid] AND uid = $eid)
OR (bid = $eid AND uid = $pid) LIMIT 1");
if(mysqli_num_rows($res) == 0){
mysqli_query($con,"Insert into t1 (pid,ust) values ($pid,$ust)");
}
Any help is greatly appreciated. Thanks