您好,我目前正在尝试为学校项目创建一个博客,这是我想出的代码。
<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>
基本上我只是想让它在网站上发布新闻,我从这里和那里借了一些代码,每当我尝试时都会出现一些错误。非常感谢您的帮助。:-)