![]() |
check if thread exist
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: |
You are looking for a simple SQL, that can do the job once?
|
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.
|
MarcoH64 Yeah
|
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. |
thank you very much
|
All times are GMT. The time now is 01:14 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|