i've created a simple blog system which connects to my DB and retrives information from a db named login and a table named news. The problem is that it doesn't post the info even though it connects. Heres my code:
<html>
<?php
$host = '127.0.0.1';
$user = 'root';
$password = 'ascent';
$webdb = 'login';
$newstable = 'news';
$con = mysql_connect($host,$user,$password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
if (isset($_GET['newsid']))
{
$id = (int)$_GET['newsid'];
mysql_select_db($webdb);
$result = mysql_query("SELECT * FROM news WHERE id='".$id."'");
$row = mysql_fetch_assoc($result); ?>
<div class='box_two_title'><?php echo $row['title']; ?></div>
<?php
echo $row['body'];
}
?>
Hello
</html>
Thank you for all your helpful answers so far but it still doesn't post :S