Link to home
Start Free TrialLog in
Avatar of antontolentino
antontolentinoFlag for United Arab Emirates

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_SETTINGS"
"ACP_GALLERY_USER_SETTINGS"
"ACP_GALLERY_GUEST_SETTINGS"
"ACP_GALLERY_WATERMARK_SETTINGS"
"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
Avatar of cr4ck3rj4ck
cr4ck3rj4ck
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of antontolentino

ASKER

How about drop row?? (second instruction)

will it be

ALTER TABLE table_name DROP ROW column_name
You cannot drop a row...The row contains data related to different columns

Regards
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
that is how I will execute this?

REMOVE the row "gallery_version" FROM the "phpbb3_config" table,
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
Thanks. I manage to remove the rows by browsing from phpmyadmin.