Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
255 views
in Plugins by
I would like detail steps to modify the php code for adding

a table to MySQL. My table would have 2 fields - categoryid and externalurl.

The externalurl field would be displayed to the right of the category name

provided by the category plugin.

I only want to make the necessary modifications and not make huge changes.

1 Answer

+1 vote
by

public static function init_queries($tablesexisting)

    {

require_once QA_INCLUDE_DIR."db/selects.php";

if (!in_array(qa_db_add_table_prefix('table_name'), $tablesexisting)) {

            return

                'CREATE TABLE IF NOT EXISTS ^table_name (

                    id INT AUTO_INCREMENT PRIMARY KEY,

cid INT NOT NULL,

url VARCHAR(300) NOT NULL

                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;';

        }

return null;

}

This is the code for add a table if it not exist in the database.

...