Getting error message 1146 table doesn't exist

Asked by:
capecodheaven / 11 Points
Time:
2012-07-05 8:15 pm EST
Category:
Databases
Hits:
2,646
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

To ask this user for more information, please first login.

To submit an answer, please login.

ANSWERS

0

arnelc
Staff
17,314 Points
2012-07-05 8:46 pm EST
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.

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 757-416-6627 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.
}