📜  php mysqli 主键 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:28.198000             🧑  作者: Mango

代码示例1
$sqlcmd = "select * from YOURTABLE";
$result = mysqli_query($conn, $sqlcmd);
while($meta = mysqli_fetch_field($result)){
    if ($meta->flags & MYSQLI_PRI_KEY_FLAG) { 
          //it is a primary key!
    }
}
//To check if a column is primary key using php