There isnt an actual error, but it's still displaying an error message when a user who is not the buyer or seller goes to the page. Is it possible to suppress the error message?
Direct link to images
//transaction id
$transactionid = $_GET['id'];
//Retrieve info about transaction
$query = "SELECT ads.*, feedback.*, transactions.* FROM (ads INNER JOIN transactions ON ads.id=transactions.ad_id) INNER JOIN feedback ON transactions.id=feedback.transaction_id WHERE transaction_id = '$transactionid'";
$data = mysqli_query($dbc, $query);
$row = mysqli_fetch_array($data);
$seller = $row['seller'];
$buyer = $row['buyer'];
//check if user is buyer or seller
if ($_SESSION['user_id'] == $seller) {
$query = "SELECT * FROM feedback WHERE transaction_id = '$transactionid' AND seller_comment IS NULL";
$data1 = mysqli_query($dbc, $query);
} else if ($_SESSION['user_id'] == $buyer) {
$query = "SELECT * FROM feedback WHERE transaction_id = '$transactionid' AND buyer_comment IS NULL";
$data1 = mysqli_query($dbc, $query);
}
//if user is buyer/seller echo form to them to submit feedback
if (mysqli_num_rows($data1) == 1) {
echo '<p><form method="post" action="feedback.php?id=' . $transactionid . '&action=submitfeedback">
<textarea id="feedback" name="feedback" rows="10" cols="30"></textarea><br/>
<input type="submit" value="Submit" name="submit" /></form></p>';
} else {
echo '<p>feedback already given</p>';
}