The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hello
i got table that got threadid but some of the threads were deleted how can i check if the threadid from my table still exist in the thread table and if not to delete it ?? :surprised: |
#2
|
|||
|
|||
![]()
You are looking for a simple SQL, that can do the job once?
|
#3
|
||||
|
||||
![]()
use the fetch_info function and then check to see if it returns a thread_id, if it doesnt run a delete query to delete that entry from your table.
|
#4
|
|||
|
|||
![]()
MarcoH64 Yeah
|
#5
|
|||
|
|||
![]()
You could do something like:
[sql]DELETE FROM mytable WHERE NOT EXISTS (select threadid FROM thread WHERE thread.threadid = mytable.threadid)[/sql] The above will only work for MySQL 4.1 (or was it 4.0) and above. PS This was not tested, so use on a test database first. |
#6
|
|||
|
|||
![]()
thank you very much
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|