You may have seen from my previous questions, I'm brand new to PHP (and coding) and I'm stuck with this.
I've created this code (try not to cringe):
<?php
$result = mysql_query("SELECT `user_id`, `username`, `email` FROM `users` WHERE `approved` = '0' ORDER BY `username`;");
echo "<table>";
while($row = mysql_fetch_array($result))
{
echo "<tr><td align=center>" . htmlspecialchars($row['username']) . "</td><td> | </td><td align=center>" . htmlspecialchars($row['email']) . " </td><td> | </td><td><a href=\"approve_user.php?phpuser_id=$row['user_id']\"><font color=\"green\">Approve</font></a> | </td><td><a href=\"deny_user.php?user_id=$row['user_id']\"><font color=\"red\">Delete</font></a></td>";
}
echo "</table>";
?>
It connects to the database in another file, returns all of the results successfully etc. However, the problems come when I try adding the 'Approve' and 'Delete' links. I want the approve link to go to approve_user.php?user_id=$row['user_id']
and I want the delete link to go to deny_user.php?user_id=$row['user_id']
.
I'm getting the error:
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\liste\approve.php on line 22
Line 22 is the echo in the while loop. I know I've messed up big time on that line somewhere, but for the life of me I can't figure out where. Help is appreciated. Thanks!