Hello i’m currently trying to create a blog for a school project and this is the code i’ve come up with.
<html>
<?php
$connection['host'] = '127.0.0.1';
$connection['user'] = 'root';
$connection['password'] = 'ascent';
$connection['webdb'] = 'login';
$connection['newstable'] = 'news';
if (isset($_GET['newsid']))
{
$id = (int)$_GET['newsid'];
connect::selectDB('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
Some cool way to post the "body" row here.
?>
</html>
Basicly i just want it to post the news on the website, i’ve loaned a bit of code from here and there and there’s a couple of errors whenever i try. Help is greatly appreciated. 🙂
I have seen your code actually there are some errors in your code so firstly you have to connect with mysql database connection and then select DB. i am giving you the correct code so try this definitely it will help to create your blog.