Solved

MySQL query table not found error

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

A lot of articles have been written on splitting mysqldump and grabbing the required tables. A long while back, when Shlomi (http://code.openark.org/blog/mysql/on-restoring-a-single-table-from-mysqldump) had suggested a “sed” way, I actually shell …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
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…

776 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