I am writing a script for a website's back end that basically works like comment approval on myspace.
Here's the problem code I'm using:
$results = mysql_query("SELECT id FROM comments WHERE status = 'Queued'");
while ($row = mysql_fetch_row($results))
{
$status = stripslashes($_POST['$row[0]']);
print "$status";
}
What it's supposed to do is the user submits their choice of approved or disapproved on all of the queued comments on page 1. Page 1 goes into the mysql database and makes the "name" of each pulldown menu the id number in the database. Once they submit and go to page 2 (where the above code is), the script should pull the id number of all comments with the queued status from the database and make them a $_POST variable to pull the information from the aformentioned submission. However, it doesn't take for some reason. If I just typed:
print "$row[0]";
... it works fine.
So I'm kind of stumped as to why I can't get that little bastard to work in the $_POST variable.
HELP please!
Here's the problem code I'm using:
$results = mysql_query("SELECT id FROM comments WHERE status = 'Queued'");
while ($row = mysql_fetch_row($results))
{
$status = stripslashes($_POST['$row[0]']);
print "$status";
}
What it's supposed to do is the user submits their choice of approved or disapproved on all of the queued comments on page 1. Page 1 goes into the mysql database and makes the "name" of each pulldown menu the id number in the database. Once they submit and go to page 2 (where the above code is), the script should pull the id number of all comments with the queued status from the database and make them a $_POST variable to pull the information from the aformentioned submission. However, it doesn't take for some reason. If I just typed:
print "$row[0]";
... it works fine.
So I'm kind of stumped as to why I can't get that little bastard to work in the $_POST variable.
HELP please!