Hello Forum,
I'm still new to php and I was hoping someone here could help me with my code.
here is my php function:
PHP Code:<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php';
function totalpartners()
{
$result = mysqli_query($link, 'SELECT COUNT(*) FROM partners');
if (!$result)
{
$error = 'Database error counting partners!';
include 'error.html.php';
exit();
}
$row = mysqli_fetch_array($result);
return $row[0];
}
?>
My error comes from this code that is calling the function...
<?php echo htmlspecialchars($totalpartners, ENT_QUOTES, 'UTF-8'); ?>
Thank you for taking the time to read my post and any help would be greatly appreciated. --Ben



Reply With Quote


.


Bookmarks