u can do so by
$db = mysql_connect("host", "user", "password");
mysql_select_db("tablename", $db);
$result = mysql_query("show create table table1", $db);
list($table, $structure) = mysql_fetch_row($result);
or using mysqldump which is usually bundled with mysql.
this command in the shell will output the structure of a table to a file
$ mysqldump --add-drop-table -uuser -ppassword DatabaseName TableName > filename.sql
where
-u - database user
-p - db password