The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
MySQL syntax error for delete
What is wrong with this query?
Code:
DELETE FROM vbpmtext, vbpm, vbpmreceipt WHERE (vbpm.pmid = vbpmreceipt.pmid) AND (vbpm.pmtextid = vbpmtext.pmtextid) AND vbpmtext.dateline < $time PHP Code:
Quote:
|
#2
|
|||
|
|||
You can't delete 3 table elements at the same time... you have to run three queries for that.
|
#3
|
|||
|
|||
You don't need to put the query into a variable then the variable into a method.
You can just use $db->query_write() Example: PHP Code:
The syntax is "DELETE FROM [table]". You don't list the fields. |
#4
|
||||
|
||||
That depends if he's using a vBulletin backend or not.
|
#5
|
|||
|
|||
He called "global.php" so I'm assuming he is.
|
#6
|
|||
|
|||
What is the MySQL version you are using and what is the exact error message you get?
|
#7
|
|||
|
|||
Update: I'm not getting error messages using either of the following MySQL statements:
Version 1 (works): PHP Code:
PHP Code:
I will release this as an add-on when it's fully tested in case anyone else might find it useful. I'm using PHP v4.4.4 with MySQL v4.1.21. |
#8
|
||||
|
||||
This is an interesting topic, and I'll have to take a look at your version 1 query since I've never used USING. I've had a lot of trouble doing cross-table deletes recently, and so far I've found that listing the fields (table1.*, table2.*) and avoiding aliases seems to work the best.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|