Welcome, Guest. Please login or register.
Did you miss your activation email?
23 Jul 2008, 14:12

Login with username, password and session length
Home Chat Help Search Calendar Login Register
Pages: [1]
Print
Author Topic: SitePusher - problems with 'show tables'  (Read 203 times)
0 Members and 1 Guest are viewing this topic.
Otico
Forum Member
*

Karma: 1
Offline Offline

Posts: 11

Location: Stuttgart; Germany


« on: 16 May 2008, 05:19 »

Hi there,
within the SitePusher-module you use the script named mysql.php, and in this a command
SHOW TABLES FROM $dbname;
which does not work with my host.
My hoster only gave me on mysql-database named somethong like 12345-0.
I figured out, that using 'SHOW TABLES FROM 12345-0 gives an error 1064. if I used 'SHOW TABLES' everything would work.

Here's my question: why use the FROM - as the database was selected in the mysql.php just some lines above the SHOW-command?
Could this be changed in the next release of the module?

Thanks, Otico
Logged
leifnicholz
Forum Member
*

Karma: 1
Offline Offline

Posts: 174

Location: Olympia, WA



« Reply #1 on: 10 Jun 2008, 17:38 »

This reply might be a little too late but here's what I think... You're probably getting that error because you typed in the wrong syntax. To show tables from any mysql database, you should first tell the mysql command line what table to use... you can do this by typing:

Code:

USE table_name;


Where "table_name" represent the name of the table you want to use.
Only after that can you tell mysql to show the contents of the selected table. That's why when you typed this code:

Code:

SHOW TABLES;


mysql worked properly. That's probably because the database that you are using is currently selected by default or is the only database available in your site.
« Last Edit: 10 Jun 2008, 17:42 by leifnicholz » Logged

I'm using:
     • CMSMS 1.3.1 "Havana"
     • IIS 5 on Windows XP Pro
     • PHP 5
     • MySQL 5
Pages: [1]
Print
Jump to: