Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.