newbtophp Posted January 14, 2010 Share Posted January 14, 2010 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 More sharing options...
Catfish Posted January 14, 2010 Share Posted January 14, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.