Есть код:
CODE (htmlphp):
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?
- $comment=mysql_query("SELECT
- comments.comment,
- comments.user_name,
- comments.year,
- p.id
- FROM comments
- JOIN peoples p ON p.id = comments.id_people
- WHERE p.name_ru LIKE '".$_GET['act']."'
- ORDER BY p.id DESC", $db);
- while ($tables = mysql_fetch_assoc($comment)) {
- echo $tables['user_name'].'<br/>';
- echo $tables['comment'].'<br/>';
- echo $tables['year'];
- $people_id=$tables['id'];
- }
- ?>
- <form action="" method="POST">
- <input type="text" name="login" /><br/>
- <input type="text" name="email" id="" /><br/>
- <textarea name="comment"></textarea><br/>
- <input type="submit" value="Комментировать" />
- <?
- mysql_query("INSERT INTO comments (comment, id_film, id_people, user_name, email, year) VALUES ('".$_POST['comment']."', 0, ".$people_id.", '".$_POST['login']."', '".$_POST['email']."', '".date("Y-m-d")."')",$db);
- }
- ?>
- </form>
- <br/>