MysQL database table isue

Creating desktop or client-server database solutions?

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
mactuan12
Posts: 1
Joined: Sat Jan 11, 2020 3:54 am

MysQL database table isue

Post by mactuan12 » Sat Jan 11, 2020 3:58 am

I have a slight problem that I cannot find reference to.

What I am able to do successfully:
- Connect to a database on a hosted GoDaddy server with two types of access (full and read-only).
- Disconnect from the database.

Okay, so that is less than impressive. When I try any query, I get the error that the table does not exist in the database. Using other database tools, I know exactly what the structure of my database is. Here is an example of my problem:

Any query on the table "account" returns an error that the table does not exist. What I cannot figure out is why the database name is being prepended to the database table name.

Any help would be greatly appreciated.

bogs
Posts: 4083
Joined: Sat Feb 25, 2017 10:45 pm

Re: MysQL database table isue

Post by bogs » Sat Jan 11, 2020 10:58 am

If I understand your post correctly, you already found the problem, i.e. -
the database name is being prepended to the database table name
That would certainly stop you from finding that particular table. The question really boils down to 'how are you getting the information to build the name'.

Unfortunately, you did not post any of the code you are using, so it is a bit more difficult to find that out, but it seems to me that you are probably submitting your query using variables filled in with the table name. While you are creating them, or when you are calling them, you have combined the two into one.

That is the only way I know of where a name would be pre-pended with another name.
Image

Klaus
Posts: 11411
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: MysQL database table isue

Post by Klaus » Sat Jan 11, 2020 11:30 am

Hi mactuan12,

welcome to thew forum!

What Bogs said, we need more info about what you scripted so far.
And a little "Hello" or something would not have hurt for the very first posting.


Best

Klaus

SparkOut
Posts: 2052
Joined: Sun Sep 23, 2007 4:58 pm

Re: MysQL database table isue

Post by SparkOut » Sat Jan 11, 2020 11:42 am

On some hosting services (I have no experience with GoDaddy) the MySQL set up will generate a table prefix automatically when created. So it could be that you created the table with the name 'accounts' but it got the name 'mc_accounts' if the table prefix happened to be 'mc_' for instance. But that would not explain why you don't see the same results when looking at the db structure with other tools. So quite likely it is a script issue, as mentioned above. Can we see more please?

Also, how does this relate to MobGUI?

bogs
Posts: 4083
Joined: Sat Feb 25, 2017 10:45 pm

Re: MysQL database table isue

Post by bogs » Sat Jan 11, 2020 11:55 am

SparkOut wrote:
Sat Jan 11, 2020 11:42 am
Also, how does this relate to MobGUI?
I was wondering that myself, but had too many other wonders going on at the time. Klaus, may we have a table change please? :mrgreen:
Image

Klaus
Posts: 11411
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: MysQL database table isue

Post by Klaus » Sat Jan 11, 2020 12:38 pm

Your fish is my kommand, Sire!

Post Reply

Return to “Databases”