开发者

SHOW CREATE TABLE

how can you put the database name in this syntax?

SHOW CREATE TABLE $table FROM $this->db

this still t开发者_StackOverflow社区ells me:

No database selected


You should select a database:

$connection = mysql_connect($host, $user, $pass);
mysql_select_db($db, $connection);


First try:

USE databasename;

Then read doc about SHOW CREATE TABLE (or other version, according to your needs)

Edit: Oh yes, of course in the context of PHP, use the mysql_select_db function )


Before you create a table, select a database:

USE dbname


Alternately:

SHOW CREATE TABLE `databasename`.`tablename`;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜