Can't use function return value in write context
Posted: Tue Apr 03, 2007 3:01 am
I have written a while loop that fetches data from a mysql query. On each iteration of the loop the data is saved to an array if it was not one of the pieces of data marked for deletion. If it was marked for deletion, then that row is deleted from the table.
When this code is ran I get
What exactly have I done wrong? Also, I am most likely wrong, but in the error message does it mean 'right' as in correct instead of write (just think that'd be a humorous bug)?
Code: Select all
$i = 1;
while($row = mysql_fetch_assoc($result)) {
if (!isset($_POST['btnunarchive'])) {
if (!isset($_POST['chk' . $i])) {
$noteinfo[--$i]['note'] = $row['note'];
$noteinfo[--$i]['author'] = $row['author'];
$noteinfo[--$i]['time'] = $row['time'];
}
}
elseif (isset($_POST['btnunarchive'])) {
if (isset($_POST('chk' . $i))) {
$qunarchive = "DELETE FROM archive WHERE id = $row['id']";
$uaresult = mysql_query($qunarchive);
echo 'Note ' . $row['$id'] . 'was deleted.<br />';
}
}
$i++
}Line 101 isFatal error: Can't use function return value in write context in /var/www/workspace/notes/archive.php on line 101
Code: Select all
if (isset($_POST('chk' . $i))) {