Database Error

epiz_26170701 (e.g. epiz_XXX) or Website URL

Account

Error Message

Error: INSERT INTO promo/trn_logs (username, type, date, time, log) VALUES (‘test’, ‘Training’, ‘test’, ‘test’, ‘test’)
No database selected

Other Information

I recently switched from hosting my website locally to InfinityFree and when I try and create a log on my site, I get this error after pressing submit.

Have you already tried to create a database using the Control Panel for the website?

1 Like

It does sound like either you haven’t created a database through the control panel yet, or you haven’t configured your code correctly to use it.

When establishing the MySQL connection, you should be able to specify the name of the database to connect to (not to be confused with the database hostname). Please make sure you’re doing that in your code.

Also, I’m not sure if your use of promo/trn_logs is valid. AFAIK the slash character is not a valid character for table names. This may cause the connection to select the wrong database. Can you please double check the database table too?

5 Likes

Adding more in this database hostname is different for infinityfree hosting service which you can find in your vistapanel sidebar.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.