Prevent duplicates in database

前端 未结 4 1569
有刺的猬
有刺的猬 2021-01-25 16:45
$db->query(\"SELECT * FROM \".DB_PREFIX.\"users WHERE uid=\'\".$uid_id.\"\' AND login=\'ExpressCheckoutUser\'\");
                if ($db->moveNext())
                     


        
4条回答
  •  说谎
    说谎 (楼主)
    2021-01-25 17:12

    Considering your last edit which says

    uid is set to primary by pinnaclecart. so wouldnt it be 'dangerous' to set it to be unique instead?

    In this case, don't do that. And don't do anything at all, PRIMARY KEY is UNIQUE by default, so it can not be duplicated.

提交回复
热议问题