PhotoShare/models/comment.php
Muhammad Anas Rashid 34753111ed My First Web application .. a real shitty one
My First Web application .. a real shitty one
2016-01-28 23:32:09 +05:00

23 lines
538 B
PHP

<?php
require_once("../models/DataAccessHelper.php");
class comment
{
public static function insertComment($imgId,$username, $str)
{
$query ="insert into imgcomments(imgId,username, commentstr) values('$imgId','$username', '$str')";
$result=DataAccessHelper::insertQuery($query);
if($result===TRUE)
{
return true;
}
return false;
}
public static function getComments($imgId)
{
$query="select * from imgcomments where imgId=".$imgId;
$result=DataAccessHelper::executeQuery($query);
return $result;
}
}
?>