Behöver hjälp med ett kommentarsfält jag gjorde efter en guide i datormagazin nr 11 -09
här är koden:
<?php
class comment extends mode1
{
function get_commets ($video_id)
{
// Hämta kommentare till angivet videoklipp
$this->db->select ( `author, coment, date, id´) ->from (`comments´)->where (`video´, $video_id->order_by"date, id", "desc");
$query = $this->db->get();
return $query->result_array();
}
function get_latest_comment()
{
//hämta senaste kommentar
$this->db->select(`*´)->from(`video`)->join(`comments´, `comments.video = video.id´, `inner´)->order_by(`comments.date, comments.id`, `desc´)->limit(1, 0;
$query = $this->db->get();
return $query->row_array();
}
function insert_comment($video_id)
{
// spara kommentar
$this->video = $video_id;
$this->author = $_post[`author];
$this->comment = $_post[`comment];
$this->date = date("Y-m-d");
$this->db->insert(`comments´,$this);
}
}
?>
är det något fel i koden eller ska man inte klistra in den under body taggen i ett html dokumet?