Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

MySQL query table not found error

Posted on 2010-11-22
3
437 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CheckListBox usage 3 71
problems with mysql ODBC Connector and vbscript 4 39
MySQL  on Tomcat 8 68
Currency in SQL? 2 30
Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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