显示创建表

how can you put the database name in this syntax?

SHOW CREATE TABLE $table FROM $this->db

this still tells me:

No database selected

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 )

You should select a database:

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

Before you create a table, select a database:

USE dbname

Alternately:

SHOW CREATE TABLE `databasename`.`tablename`;