Solved

MySQL query table not found error

Posted on 2010-11-22
3
429 Views
Last Modified: 2012-08-13
Hello all.

Super easy question but I just can't seem to find the syntax error.

I'm getting the error "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'techatco_mage.t' doesn't exist"

from the query attached. For some reason it is taking the alias as the table.

Could anyone help? Thanks much.


$sqry = "select t.topic_id from ".$faqsTopicTable." t,".$faqsStoreTable." s WHERE t.default='1'
                                 and t.topic_id = s.topic_id
                                 and s.store_id= ".Mage::app()->getStore()->getId()."
                                 order by update_time desc limit 1;";

Open in new window

0
Comment
Question by:techatcost
  • 2
3 Comments
 
LVL 58

Expert Comment

by:cyberkiwi
ID: 34190720
Your variable $faqsTopicTable has an extra "." at the end. Inspect it
0
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 500 total points
ID: 34190724
You can use
die($faqsTopicTable . "---");
just before the current line to see what is in there
0
 

Author Comment

by:techatcost
ID: 34192431
I got it. It was actually a variable declaration problem. Something sneaky with the ecommerce platform I'm using. The query works now. Thanks  - awarding points for your reply.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now