php - Insert record if the id is not present in db -
i want ask inserting record db
if give id
in url throught $getn
, check if data of id n
present in table must update else must insert data ?
how can in php plz me
you like
<?php $n = $_get["n"]; $query = "select count(*) numberofrecords table id = '$n'"; mysql_query($query); if ($numberofrecords == 0) mysql_query("insert [...]"); else mysql_query("update [...]");
Comments
Post a Comment