Heres what I have for code and it should work.
PHP Code:
<?php
//makes the connection to the database
$db_type = "mysql";
$db_host = "localhost";
$db_login = "root";
$db_password = "mypasswordhere";
$db_database = "wines";
$db_persistent = 1;
//Database Vars
define(db_host, $db_host);
define(db_user, $db_login);
define(db_pass, $db_password);
define(db_link, mysql_connect(db_host,db_user,db_pass));
define(db_name, $db_database);
mysql_select_db(db_name);
//to select the news information
$queryNews = 'SELECT * FROM `news`';
$result = mysql_query($queryNews);
$num=mysql_numrows($results);
//format the Data for Display
while($rows = mysql_fetch_array($result)){
$id = $rows["topic_id"];
$title = $rows["topic_title"];
$desc = $rows["topic_desc"];
$body = $rows["topic_body"];
$author = $rows["topic_author"];
$date = $rows["topic_date"];
}
?>
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Project Concept</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="alternate stylesheet" type="text/css" href="whitestyle.css" title="white" />
<script type="text/javascript" src="/js/styleswitcher.js"></script>
<!-- This page fully validates as XHTML 1.0 Strict on validator.w3.org (this notice can be removed) -->
</head>
<body>
<div id="outer">
<div id="inner">
<div class="bgtext">Wines</div>
<div id="close"><a href="index.html" title="close and return to menu">X</a></div>
<div id="top"><a href="#top" title="back to top">^</a></div>
<!--greyed out links-->
<div id="text1">home</div>
<div id="text2">know how</div>
<div id="text3">News</div>
<div id="text4">Photos</div>
<div id="text5">Wine Reviews</div>
<div id="text6">opinion time</div>
<div id="text7">contact us</div>
<div id="text8">Sheet Maker</div>
<!--greyed out links end-->
<div id="urltext"><a href="index.html" class="navigurl" title="click to return to the index page">home » </a>News</div>
<div id="content">
<a name="top"></a> <!-- very important! this is the anchor for the back to top feature --><div class="titleblock"><?php echo $title; ?><span style="text-align:right; margin-left:480px;"><?php echo $date; ?></span></div>
<?php echo $body; ?>
<br />
<br /><div id="postedby">Posted by: <?php echo $author; ?></div>
</div>
</div>
</div>
</body>
</html>
it should echo out my article. since there is only one article in the db am not worried about looping it. But some direction on that would be great and maybe about calling a article by id. I have a comment table ready for this but want to get the article stuff done first. can anyone help?