views:

307

answers:

1

Hi!

The SWOW CREATE TABLE query doesn't seem to give any result if the table has no rows. (At least not in my php setup.) Is there an easy way to get around that without delving into the meta tables? If so, how? :-)

EDIT:

As my comment on Quassnoi's answer below indicates, this seems to be a problem for tables named starting "x-"... Very strange!

+1  A: 

SHOW CREATE TABLE works even if there are no rows.

Could you please reproduce this with a command line client or phpMyAdmin?

Update:

- is a reserved character. You need to enclose the names like this into backticks:

SHOW CREATE TABLE `x-addresses`
Quassnoi
Thanx Quassnoi!Very strange coincidence:The empty table happened to be named `x-addresses`, and running "SHOW CREATE TABLE x-addresses" gives an error: "#1064 - You have an error in your SQL syntax... "No problem if I rename the table to "xaddresses"!
Cambiata
`-` is a reserved character. You need to enclose it into backticks: `SHOW CREATE TABLE ``x-addresses```
Quassnoi