Check if this is duplicate

后端 未结 4 609
梦谈多话
梦谈多话 2021-01-29 08:14

I want to check if the username already exists and throw an error message if exist, any tips how can I do it? I\'ve already tried to search but only found mys

4条回答
  •  鱼传尺愫
    2021-01-29 08:57

     query("select * from user where name='$user_name");
         $rowCount=$getUniqueUsername->num_rows;
    
         if($rowCount) {          
              $insertQuery=$con->query("insert into table_name (field_name) Values('".$values."'));
         }
    ?>
    

提交回复
热议问题