NAVIGATION
This shows you the differences between two versions of the page.
|
english:technics:database:phpwcms_file:sql-commands [2009/04/25 08:06] 127.0.0.1 external edit |
english:technics:database:phpwcms_file:sql-commands [2018/06/03 18:09] (current) |
||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ===== sql commands ===== | ===== sql commands ===== | ||
| + | ** | ||
| + | Tool:** phpMyAdmin | ||
| ==== gain ownership of all of 'em! ==== | ==== gain ownership of all of 'em! ==== | ||
| Line 9: | Line 11: | ||
| UPDATE TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, 'find this', 'replace with that'); | UPDATE TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, 'find this', 'replace with that'); | ||
| </code> | </code> | ||
| - | This will translate into (where "2" is the f_uid of the second admin e.g. and you yourself are the number "1") | + | This will translate into (where "2" is the "f_uid" of the second admin e.g. and you yourself are the number "1") |
| <code> | <code> | ||
| UPDATE phpwcms_file SET f_uid=REPLACE(f_uid, '2', '1'); | UPDATE phpwcms_file SET f_uid=REPLACE(f_uid, '2', '1'); | ||
| </code> | </code> | ||
| + | |||
| + | \\ | ||
| + | **Example 1:** \\ | ||
| + | All files and folders with an ID > 51. | ||
| + | <code sql> | ||
| + | UPDATE phpwcms_file SET f_uid = REPLACE( f_uid, '2', '1' ) WHERE f_id >51; | ||
| + | </code> | ||
| + | \\ | ||
| + | **Example 2:** \\ | ||
| + | All files and folders within the directory with the ID = 66. | ||
| + | <code sql> | ||
| + | UPDATE phpwcms_file SET f_uid = REPLACE( f_uid, '2', '1' ) WHERE f_pid =66; | ||
| + | </code> | ||
| + | |||
| + | |||
| But this is still a placeholder! Imagine, which wonderful (and terrible) things you can do with that command!\\ | But this is still a placeholder! Imagine, which wonderful (and terrible) things you can do with that command!\\ | ||
| And the result of the above? The folder of the second admin is plain empty and you are the winner 8-) | And the result of the above? The folder of the second admin is plain empty and you are the winner 8-) | ||
| + | |||
| + | |||
| ==== deleting some dirt ==== | ==== deleting some dirt ==== | ||
| + | |||
| + | ([[:english:technics:database:sql-commands]]) | ||
| + | |||
| + | |||
| Diving right into it we plainly execute the following: | Diving right into it we plainly execute the following: | ||
| <code> | <code> | ||
| Line 23: | Line 46: | ||
| For deleted files/pictures (only after you have cleared the trash can in filemanager and doing Admin -> remove deleted files!!! | For deleted files/pictures (only after you have cleared the trash can in filemanager and doing Admin -> remove deleted files!!! | ||
| </note> | </note> | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||