wordpress create tabel using this way not in php structure for connect:
More info hear for create, get table data for wp
function testfunc( $cf7 )
{
global $wpdb;
$table_name = $wpdb->prefix . 'tablename';
$sql = "CREATE TABLE IF NOT EXISTS ".$table_name."(
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(255) DEFAULT NULL,
UNIQUE KEY id (id)
);";
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta( $sql );
}