Скрипт обновления, up.php:
<?php
include('bd.php');
if(isset($_POST['plus'])){
$id=$_POST['id'];
mysql_query("UPDATE articles set raiting=raiting+1 where id='$id'");
}
?>
Скрипт вывода статей:
<html>
<head>
<?php
header("Content-type:text/html;charset='utf-8'");
include('bd.php');
echo '<form action="" method="post">
<input type="text" name="title"/>
<input type="submit" name="add" value="add"/>
</form>';
if(isset($_POST['add'])){
$title=$_POST['title'];
$rait=0;
mysql_query("INSERT INTO articles (`id`, `title`, `raiting`) VALUES('id', '$title', '$rait')");
}
$result=mysql_query("SELECT*FROM articles order by id DESC");
while($myrow=mysql_fetch_array($result)){
echo $myrow['title']."<br/><form method='post' action='up.php'><input type='hidden' name='id' value='".$myrow['id']."'>
<input type='submit' name='plus' class='vote' value='+'></form> ".$myrow['raiting']."<hr>";
}
?>
</head>
<body>
</body>
</html>
Тут вроде все просто, но у меня ничего не выходит :1128: