Hi all, I need help regarding the following issue. Say for example I am creating a Adminpanel that allows an admin to monitor the site. I wish to have a function whereby admin can approve or delete reveiws submitted by users. I have a database table named reviews, and a field review_status = (default at 0) so when a user submits a review, the status is set at 0. What should I script in the PHP so that the admin can insert into review_status that an approved review would have 1 and if the review contains anything unwanted the admin can delete the review? Your help and suggestion is greatly appreciated. Please advice. <? echo "</head> <body onload=\"FullScreen_go();\"> <div>"; $header = "Pending Reviews"; include("header.html.php"); $query = "SELECT * FROM reviews where review_status = 0 ORDER BY id ASC"; $approve = ""; $delete = ""; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_row($result)) { echo "<div style='height:65px;'><tr>"; echo "<td><ul><font color=666666>Restaurant:</font>".$row[1]."<br>"; echo "<font color=666666>Title: </font>".$row[6]."<br>"; echo "<font color=666666>Review: </font>".$row[7]."<br>"; echo "<font color=666666>Written By: </font>".$row[8]."<br>"; echo "<font color=666666>Date Joined: </font>".$row[9]."<br>"; echo "<font color=666666>Review Status:</font><b> Approve | Delete </b><br>"; echo "</tr>"; echo "</table>"; echo "</div>"; } ?> Code (markup):
if your php knowledge is equal to 0 this is no place go to w3 schools or tizag first and learn basic things then you can ask
You can make these Approve | Delete as links which passes the id = approve or id=delete and use $_GET[id] to get the parameter value and perform the needed operation Thanks !!