Friday, September 28, 2018

php - Fatal Error: Uncaught exception 'PDOException'

I downloaded this website directory and when I ran it, I received the following error:



ERROR
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'u471047401_test.Categories' doesn't exist' in /home/u471047401/public_html/inc/blocks/sidebar.php:13 Stack trace: #0 /home/u471047401/public_html/inc/blocks/sidebar.php(13): PDOStatement->execute(Array) #1 /home/u471047401/public_html/index.php(6): require('/home/u47104740...') #2 {main} thrown in /home/u471047401/public_html/inc/blocks/sidebar.php on line 13




    $cat = $_GET['cat'];
if(empty($cat))
{
$cat = 0;
}
$menu_query = ("
SELECT cat_id, cat_name, parent_cat
FROM Categories

WHERE (cat_id = ? OR parent_cat = ?)");

$stm = $conn->prepare($menu_query);
$stm->execute(array($cat, $cat));
("u471047401_test.Categories");
$categories = $stm->fetchAll();

?>






What is causing this error?

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & 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...