antontolentino
asked on
SQL command for phpmyadmin to drop/remove some tables and rows
Hi,
I had an experience from phpmyadmin where my intention is to remove only a row but i endup removing the entire table. I dont want that to happen again so I would ask for experts code :)
I want to carry out this instruction via phpmyadmin.
=======================
REMOVE the column "user_gallery_notify" FROM "the phpbb3_users" table,
REMOVE the row "gallery_version" FROM the "phpbb3_config" table,
and then FROM the modules table to find (by langname) and REMOVE the rows
"ACP_CAT_GALLERY"
"ACP_GALLERY_MANAGEMENT"
"ACP_GALLERY_MANAGE_ALBUMS "
"ACP_GALLERY_CREATE_ALBUM"
"ACP_GALLERY_MANAGE_CACHE"
"ACP_GALLERY_SETTINGS"
"ACP_GALLERY_GENERAL_SETTI NGS"
"ACP_GALLERY_USER_SETTINGS "
"ACP_GALLERY_GUEST_SETTING S"
"ACP_GALLERY_WATERMARK_SET TINGS"
"UCP_GALLERY_PREFS"
Then drop the main gallery tables
"phpbb3_gallery_albums"
"phpbb3_gallery_comment"
"phpbb3_gallery_config"
"phpbb3_gallery_pics"
"phpbb3_gallery_rate"
"phpbb3_gallery_users"
====================
I had an experience from phpmyadmin where my intention is to remove only a row but i endup removing the entire table. I dont want that to happen again so I would ask for experts code :)
I want to carry out this instruction via phpmyadmin.
=======================
REMOVE the column "user_gallery_notify" FROM "the phpbb3_users" table,
REMOVE the row "gallery_version" FROM the "phpbb3_config" table,
and then FROM the modules table to find (by langname) and REMOVE the rows
"ACP_CAT_GALLERY"
"ACP_GALLERY_MANAGEMENT"
"ACP_GALLERY_MANAGE_ALBUMS
"ACP_GALLERY_CREATE_ALBUM"
"ACP_GALLERY_MANAGE_CACHE"
"ACP_GALLERY_SETTINGS"
"ACP_GALLERY_GENERAL_SETTI
"ACP_GALLERY_USER_SETTINGS
"ACP_GALLERY_GUEST_SETTING
"ACP_GALLERY_WATERMARK_SET
"UCP_GALLERY_PREFS"
Then drop the main gallery tables
"phpbb3_gallery_albums"
"phpbb3_gallery_comment"
"phpbb3_gallery_config"
"phpbb3_gallery_pics"
"phpbb3_gallery_rate"
"phpbb3_gallery_users"
====================
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You cannot drop a row...The row contains data related to different columns
Regards
Regards
ASKER
then that would mean the instruction is not correct?
No of course Not...You can remove a row by making a delete query:
delete from table_name where field_name=Any_criteria
delete from table_name where field_name=Any_criteria
ASKER
that is how I will execute this?
REMOVE the row "gallery_version" FROM the "phpbb3_config" table,
REMOVE the row "gallery_version" FROM the "phpbb3_config" table,
ASKER
I still don't understand.. can you just translate the ROW deletion part into exact sql command.
gallery_version is not a row, it is a column name. The following would get rid of the column from the table:
ALTER TABLE phpbb3_config DROP COLUMN gallery_version
ALTER TABLE phpbb3_config DROP COLUMN gallery_version
ASKER
Thanks. I manage to remove the rows by browsing from phpmyadmin.
ASKER
will it be
ALTER TABLE table_name DROP ROW column_name