Skip to content

Instantly share code, notes, and snippets.

@Toxiapo
Created September 13, 2019 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Toxiapo/c77c2ee27664015e6f57bdc66d1b0178 to your computer and use it in GitHub Desktop.
Save Toxiapo/c77c2ee27664015e6f57bdc66d1b0178 to your computer and use it in GitHub Desktop.
PHP: Describe table
$query = "DESCRIBE tablename";
$result = $db->query($query);
while ($row => $result->fetch_array()) {
echo "{$row['Field']} - {$row['Type']};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment