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>
\?= htmlspecialchars($article['summary'])?>
Published in \?= $article['category_id']?>
through \a href="member.php?id="$article['member_id'] ">
($article['author']) \?= htmlspecialchars(?>)
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(?>)