Jump to content

Get mysql column comments with php?


dcgamers

Recommended Posts

$query = 'SELECT column_comment AS comment FROM information_schema.columns WHERE table_schema = "Database Name Here" && table_name = "Table Name Here" && column_name = "Column Name Here"';

 

$result = mysql_query($query, $connection) or die(mysql_error());

 

$comment = mysql_fetch_array($result);

 

echo($comment['comment']);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.