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`;
精彩评论