MySQL query table not found error

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

techatcostAsked:
Who is Participating?
 
cyberkiwiCommented:
You can use
die($faqsTopicTable . "---");
just before the current line to see what is in there
0
 
cyberkiwiCommented:
Your variable $faqsTopicTable has an extra "." at the end. Inspect it
0
 
techatcostAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.