php mysqli primary keys
$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