Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8448547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:27:26+00:00 2026-06-10T10:27:26+00:00

How I can run a command in phpMyAdmin which will drop all columns in

  • 0

How I can run a command in phpMyAdmin which will drop all columns in a database that have the prefix test_.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:27:28+00:00Added an answer on June 10, 2026 at 10:27 am

    To drop a column from a table, use the syntax:

    alter table <tablename> drop column <columnname>
    

    To find all the columns in a table in a database that start with test_, do the following:

    select column_name
    from INFORMATION_SCHEMA.columns
    where table_name = <table_name> and
          table_schema = <schema_name> and
          left(column_name, 5) = 'test_'  -- not using "like" because '_' is a wildcard char
    

    If you were doing this manually, I would recommend running the following query and then pasting the results in to a mysql query interface:

    select concat('alter table ', table_name, ' drop column ', column_name)
    from INFORMATION_SCHEMA.columns
    where table_name = <table_name> and
          schema_name = <schema_name> and
          left(column_name, 5) = 'test_'
    

    You can do something similar in code, by running the query, returning the results and then running each row as a query.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In C# VS2008 I have a service which can run from command line and
I can run this command in SqlManager to detach the db ALTER DATABASE mydb
Is there a command I can run inside my SQL script so that it
I want create a ruby script that I can run on the command line
I'm working on creating a single command that will run mulitple things on the
I need a doc to rtf converter that will run from the command line,
Is there a variant of subprocess.call that can run the command without printing to
I would like a command line function that I can run on any file
i can succesfully run crawl command via cygwin on windows xp. and i can
Possible Duplicate: Can I run from command line program created by Eclipse? I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.