NAVIGATION
This shows you the differences between two versions of the page.
|
english:technics:database:phpwcms_file:sql-commands [2009/05/12 00:28] Knut Heermann (flip-flop) |
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-) | ||