Answers for "php mysqli primary keys"

0

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
Posted by: Guest on August-03-2021

Browse Popular Code Answers by Language