?Ask This problem keeps coming up when I try to display the category name - How do I fix it

  • Please we urge all unregistered users to swiftly register to enable you enjoy loads of benefits rollingout in our community. Be open to opportunities to do good for someone else today. Anything that do not please God in your life has come to distroy you.
banner

AdServersite

Member
Premium User
Nov 24, 2023
173
0
16
33
Abuja Nigeria
I continue to receive this error message:
Warning: At line 33 of C:\xampp\htdocs\index.php, an attempt is made to retrieve an array offset on a value of type bool.It's

Uncaught TypeError: htmlspecialchars() - fatal error $string ($string) is the first argument, and null is provided in C:\xampp\htdocs\index.php:33. Stack trace: 0 C:\htdocs\xampp\index.php(33): At line 33 of C:\xampp\htdocs\index.php, htmlspecialchars(NULL) #1 {main} is thrown.The code is as follows:
Declare(strict_types = 1) in PHP \?
'includes/connection.inc.php' and 'includes/Functions.inc.php' are required.
$id = filter_input(FILTER_VALIDATE_INT, 'id', INPUT_GET);
$sql = "SELECT name, description, and id FROM category WHERE id=:id;"; $category = pdo($pdo, $sql, [$id])->fetch(); $sql = "SELECT a.id, a.summary, a.category_id, a.member_id, c.name AS category, CONCAT(m.forename,'', m.surname) AS author,
FROM article AS a JOIN category AS c ON a.category_id = c.id JOIN member AS m ON a.member_id = m.id i.file AS image_file, i.alt AS image_alt
RIGHT-JOIN picture AS I ON
Image AS i ON a.image_id = i.id; LEFT JOIN

WHERE a.published = 1 ORDER BY a.id DESC; AND a.category_id = :id;";

$articles = pdo([$id])->$pdo, $sqlfetchAll();
$category['name']; $title =?>
content="width=device-width, initial-scale=1.0">Record
This is the location of the error.

A h1>
Foreach ($articles as $article) "Summary" class for article
"Article.php?id=1" \?= $article['id']?>alt="\?= htmlspecialchars($article['image_alt'])?>" >​

\?= htmlspecialchars($article['title'])?>​


\?= htmlspecialchars($article['summary'])?>



Published in \?= $article['category_id']?>
through \a href="member.php?id="$article['member_id'] ">
($article['author']) \?= htmlspecialchars(?>)
 

BSF For Soul Wining Support Donation

Total amount
$0.00
Goal
$1,000.00
Donation ends: