Boofo
08-26-2002, 07:32 AM
Can someone please tell me what I have wrong with this code? I am getting a db error when I click "All Messages" and hit the delete button in the private messages sent folder. Here is the code in questiom, I think.
if ($what=="delete") {
if ($allmsgs==1) {
if (thisfolder!='') $thefolder=thisfolder; else $thefolder='0';
$DB_site->query("DELETE FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=$thefolder");
} else {
if (is_array($privatemessage) or $allmsgs==1) {
while(list($key,$val)=each($privatemessage)) {
$DB_site->query("DELETE FROM privatemessage WHERE privatemessageid=".intval($key)." AND userid=$bbuserinfo[userid]");
} //end while
} else {
eval("standarderror(\"".gettemplate("error_pmnoselected")."\");");
exit;
}
}
and here is the db error I am getting.
Database error in vBulletin 2.2.5:
Invalid SQL: DELETE FROM privatemessage WHERE userid=1 AND folderid=thisfolder mysql error: Unknown column 'thisfolder' in 'where clause'
mysql error number: 1054
Date: Monday 26th of August 2002 09:24:57 AM
Script: http://www.bearfacts2.com/forum/forum/private.php
Referer: http://www.bearfacts2.com/forum/private.php
if ($what=="delete") {
if ($allmsgs==1) {
if (thisfolder!='') $thefolder=thisfolder; else $thefolder='0';
$DB_site->query("DELETE FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=$thefolder");
} else {
if (is_array($privatemessage) or $allmsgs==1) {
while(list($key,$val)=each($privatemessage)) {
$DB_site->query("DELETE FROM privatemessage WHERE privatemessageid=".intval($key)." AND userid=$bbuserinfo[userid]");
} //end while
} else {
eval("standarderror(\"".gettemplate("error_pmnoselected")."\");");
exit;
}
}
and here is the db error I am getting.
Database error in vBulletin 2.2.5:
Invalid SQL: DELETE FROM privatemessage WHERE userid=1 AND folderid=thisfolder mysql error: Unknown column 'thisfolder' in 'where clause'
mysql error number: 1054
Date: Monday 26th of August 2002 09:24:57 AM
Script: http://www.bearfacts2.com/forum/forum/private.php
Referer: http://www.bearfacts2.com/forum/private.php