0

In local my code works very well but when I deploy my site on the web, I have this error :

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'test_7aoh.TAG' doesn't exist' in /home/vsftpd/base-test_nvd9/base-test_nvd9/sg-actus/functions/functions.php:192 Stack trace: #0 /home/vsftpd/base-test_nvd9/base-test_nvd9/sg-actus/functions/functions.php(192): PDOStatement->execute() #1 /home/vsftpd/base-test_nvd9/base-test_nvd9/sg-actus/pages/contenu-article.php(116): get_articles_similaires('4') #2 /home/vsftpd/base-test_nvd9/base-test_nvd9/sg-actus/index.php(19): include('/home/vsftpd/ba...') #3 {main} thrown in /home/vsftpd/base-test_nvd9/base-test_nvd9/sg-actus/functions/functions.php on line 192

This is the code of functions.php (line 192) :

        $sim = $bdd->prepare('SELECT CC.article_id, CC.article_titre, CC.article_image,count(*) 
                          FROM tag AA, tag BB, article CC WHERE AA.article_id = :article_id AND BB.article_id <> AA.article_id AND BB.tag_libelle = AA.tag_libelle AND CC.article_id = BB.article_id 
                          GROUP BY CC.article_id, CC.article_titre ORDER BY 3 DESC LIMIT 4');

And when i go to PhpMyAdmin, my query works very well ..

My PHP version in Wamp is 5.6.25, on Hostinger 5.5.35 and on livehost 5.6

I do not understand why it does not work .. I looked at the topics with the same error but it did not solve my problem

Thanks you in advance for your help

ElGecko
  • 69
  • 4
  • What is table `test_7aoh`? – aldrin27 Dec 26 '16 at 23:18
  • I can not find this word :o it's a name of database and my pseudo on phpmyadmin – ElGecko Dec 26 '16 at 23:24
  • Double check the joins and your table's. – aldrin27 Dec 26 '16 at 23:27
  • How should I do it ? My login credentials are correct and the names of my tables are correct. I can not find the word "test_7aoh" in my files .. – ElGecko Dec 26 '16 at 23:37
  • This is a duplicate of the question that I have pointed to. However what's puzzling is what your query says `tag` and the error message says `TAG` are you quite sure that you copy pasted the query exactly as it is? – e4c5 Dec 27 '16 at 01:50

0 Answers0