Created
August 23, 2014 04:08
-
-
Save pupi1985/fe1cda2522bb4ae4b38e to your computer and use it in GitHub Desktop.
Answer to question http://www.question2answer.org/qa/37393/ho-do-we-delete-private-messages-in-dev-1-7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_once QA_INCLUDE_DIR.'qa-db-selects.php'; | |
require_once QA_INCLUDE_DIR.'qa-db-admin.php'; | |
$query = "SHOW INDEX FROM ^messages WHERE key_name = 'tohidden'"; | |
$result = qa_db_read_one_value(qa_db_query_sub($query), true); | |
$shouldRun = !isset($result); | |
if ($shouldRun) { | |
echo "Running the update...<br>"; | |
qa_db_query_sub('DROP INDEX fromhidden on ^messages'); | |
qa_db_query_sub('ALTER TABLE qa_messages ADD KEY fromhidden (fromhidden), ADD KEY tohidden (tohidden)'); | |
echo "Update done!!<br>"; | |
} else { | |
echo "You should not run the update<br>"; | |
} | |
// Get relevant list of categories | |
$editcategoryid=qa_post_text('edit'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment