I have this page that when an article is clicked from the lisitng on previous page it contains this:
test3.php?id=16&cat=9
test3 begins like this:
<?php
$dbcnx = @mysql_connect('', '', '');
if (!$dbcnx) {
exit('<p>Unable to connect to the ' .
'database server at this time.</p>');
}
if (!@mysql_select_db('')) {
exit('<p>Unable to locate the dm' .
'database at this time.</p>');
}
$id = $_GET['id'];
$article = @mysql_query(
"SELECT title, keywords, description, articletext, authorid FROM articles WHERE id='$id'");
if (!$article) {
exit('<p>Error fetching article details: ' .
mysql_error() . '</p>');
}
$article = mysql_fetch_array($article);
$title = $article['title'];
$keywords = $article['keywords'];
$description = $article['description'];
$articletext = $article['articletext'];
$authid = $article['authorid'];
$author = msql_query(
"SELECT name FROM author WHERE id=$authid");
if (!$author) {
exit('<p>Error fetching author details: ' .
mysql_error() . '</p>');
}
$author = mysql_fetch_array($author);
$authorname = $author['name'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $title ?> :: </title>
<meta name="description" content="<?php echo $description ?>"/>
<meta name="keywords" content="<?php echo $keywords ?>"/>
<meta name="Information" content="An article by <?php echo $authorname ?> "/>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link href="../css/articles.css" rel="stylesheet" type="text/css" />
</head>
WHen ran i get this:
Fatal error: Call to undefined function msql_query() in D:\Websites\XXXXXX\articles\ est3.php on line 30
Line 30 is this line:
$author = msql_query(
"SELECT name FROM author WHERE id=$authid");
I am probably missing a { or ) but can not find it.
Even if I hard code the variable $authid in the above MySQL_Query it still breaks with a FATAL.
THank you for any help/