• Hi,

    The following query :
    SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = ‘wp_hsa_plugin’ AND column_name = ‘hsa_options’\G

    Used in Horizontal scrolling announcements plugin,

    Could be changed as :

    SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema=DATABASE() and table_name = ‘wp_hsa_plugin’ AND column_name = ‘hsa_options’\G

    As you can sed, i added table_schema=DATABASE() condition in the WHERE clause. It is very important to specify the table_schema when querying informtation_schema DB.

    The modified versinon is fast than the previous one.

    Thanks

    Stofa.

  • The topic ‘Query on information-schema’ is closed to new replies.