Getting error message 1146 table doesn't exist

Asked by:
capecodheaven
Time:
2012-07-05 5:15 pm
Category:
Databases
Hits:
725
In my php code I can see that I connected to the database but when I run the query I get error message 1146 'table xxxxxx_xxxxxxx.YYYYYYYY' doesn't exist...I have created the database and 1 table. I don't know why I get this message as I have used phpMyadmin to enter a dummy record...help!!...Tom

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

arnelc
2012-07-05 5:46 pm
Hello Capecodheaven,

Before I begin with my findings, let me identify that we do not provide coding support for your web pages. That is beyond the scope of technical support. However, we do try to point you in the right direction and give you information that will hopefully lead to a quick and simple resolution of your issues.

Generally, when I get a message that involves PHP code, I first look for error logs. Here's what I'm seeing in your error log:

[05-Jul-2012 16:57:56 UTC] PHP Warning: include() [function.include]: Failed opening 'nav.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/tsbweb5/php') in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 16:57:58 UTC] PHP Warning: include(nav.inc.php) [function.include]: failed to open stream: No such file or directory in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 16:57:58 UTC] PHP Warning: include(nav.inc.php) [function.include]: failed to open stream: No such file or directory in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 16:57:58 UTC] PHP Warning: include() [function.include]: Failed opening 'nav.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/tsbweb5/php') in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 16:58:30 UTC] PHP Warning: include(nav.inc.php) [function.include]: failed to open stream: No such file or directory in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 16:58:30 UTC] PHP Warning: include(nav.inc.php) [function.include]: failed to open stream: No such file or directory in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 16:58:30 UTC] PHP Warning: include() [function.include]: Failed opening 'nav.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/tsbweb5/php') in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 16:58:30 UTC] PHP Notice: The contact could not be added due to a system error. We apologize for any inconvenience in /home/tsbweb5/public_html/crown/contact.inc.php on line 135
[05-Jul-2012 17:01:24 UTC] PHP Warning: include(nav.inc.php) [function.include]: failed to open stream: No such file or directory in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 17:01:24 UTC] PHP Warning: include(nav.inc.php) [function.include]: failed to open stream: No such file or directory in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 17:01:24 UTC] PHP Warning: include() [function.include]: Failed opening 'nav.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/tsbweb5/php') in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 17:01:25 UTC] PHP Warning: include(nav.inc.php) [function.include]: failed to open stream: No such file or directory in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 17:01:25 UTC] PHP Warning: include(nav.inc.php) [function.include]: failed to open stream: No such file or directory in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 17:01:25 UTC] PHP Warning: include() [function.include]: Failed opening 'nav.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/tsbweb5/php') in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 17:02:42 UTC] PHP Warning: include(nav.inc.php) [function.include]: failed to open stream: No such file or directory in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 17:02:42 UTC] PHP Warning: include(nav.inc.php) [function.include]: failed to open stream: No such file or directory in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 17:02:42 UTC] PHP Warning: include() [function.include]: Failed opening 'nav.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/tsbweb5/php') in /home/tsbweb5/public_html/crown/index.php on line 26
[05-Jul-2012 17:02:42 UTC] PHP Notice: The contact could not be added due to a system error. We apologize for any inconvenience in /home/tsbweb5/public_html/crown/contact.inc.php on line 135


I only included a portion of the log. If the issue is with a database, I would check 2 things. In spite of the fact that you are saying you're making a connection to the database, the server is stating that it failed to open saying: no such file or directory. I would start with this error and then work my way to the database error. To connect with the database, you would need to have a user created that has the appropriate rights to access the database. Note: by default, when you create a user to access the database (in MYSQL DATABASES), you have to assign that user to the database. During the assignment it does appear that you are able to give ALL rights to that user, but in fact the EXECUTION rights do not exist (even though you can check it). These rights are not given due to security issues and cannot be obtained.

Additionally, if you have a user accessing the database from OUTSIDE of the server, then that user's IP address would need to be added to the firewall in order to access th database. This can be done in the REMOTE MYSQL panel in the Cpanel interface. If the user accessing the database is not accessing the database from within the server, then the database reference is typically the domain name that you have assigned it to. If it is local, then your code should be referencing the database as "localhost".

I hope this help t clarify the issue and lead you towards a solution for the problem.

If you have any further questions, please contact technical support or leave a comment at the bottom of the page.

Regards,

Arnel C.

You must login before you can post a comment about this answer.

Like this Question?

Have a Question?

If you need some help, submit your question to our Community! We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)

Recent Questions

  1. Error in sending mails from my email account
  2. I can't connect to the server with filezilla
  3. Can't login to email

Support Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.