Jump to content

How to proceed


newbtophp

Recommended Posts

Im stuck; basically i have a review system, where an author uploads something and another user can review it, then the author can respond to that review, and their can only be 1 author response per user review.

 

I know the concept behind it just unsure how to proceed  :-\

 

<?php
include("conn.php");
//the upload id
$id = clean($_GET['id']);

//this is the reviewer
$user = $_SESSION['username'];


$result = mysql_fetch_array(mysql_query("select * from portal_main where id = '$id'"));

//this is the author
$author = $result['user'];

//this would be the query to select a review
$querytoselectareview = mysql_query("SELECT review FROM portal_reviews WHERE id = '$id' AND response='0'");

//this would be the query to select a author response
$querytoselectaresponse = mysql_query("SELECT review FROM portal_reviews WHERE id = '$id' AND response='1'");

//now how would i check if the author can respond to the review?, or if the author cant etc.

?>

Link to comment
https://forums.phpfreaks.com/topic/188480-how-to-proceed/
Share on other sites

if ($result['countOfreview'] > $result['response'])
{
   // allow author to respond to review
}
else
   // don't allow author to respond

 

something like that. in the sql query change it to something like: select *,COUNT(review) as countOfreview from portal_main where id = '$id'

Link to comment
https://forums.phpfreaks.com/topic/188480-how-to-proceed/#findComment-995042
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.