Friday, May 24, 2019

php - Fatal error PDO : "Base table or view not found"

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

No comments:

Post a Comment

plot explanation - Why did Peaches&#39; mom hang on the tree? - Movies &amp; TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...