This plugin replaces how WordPress handles database calls. You should always use the “wpdb” class WordPress provides and never make the connection yourself.
OK then, where do I tell WordPress to use this database with username and password?
I just don’t understand where to write my SQL statements in my pages…
This plugin is a simple drop in for the WordPress database class. So it connects with the details in wp-config.php.
If you need to make custom SQL statements then check out http://codex.ww.wp.xz.cn/Class_Reference/wpdb.
Interesting!
Then what do I write on a WP page to access DB data? I wanna insert into a table, what do I write?
Unsure what kind of answer I need to give here. I see you are missing the basic of development or/and WordPress so below you see some additional resources. (If you need custom queries then you should read http://codex.ww.wp.xz.cn/Class_Reference/wpdb).
But when you need to display post data then check out http://codex.ww.wp.xz.cn/Class_Reference/WP_Query.
And when you need that data displayed on a certain post or page in WordPress then checkout http://codex.ww.wp.xz.cn/Shortcode_API.
All right, I’ll read that.
In fact, what I want to do, is a command form on a WP page. In normal PHP, I would call my DB with PDO. But since I’m in WP, that’s why I’m so lost.
How would you do an insert in table with that plugin enabled?
First of all this plugin doesn’t make it easier/harder to insert something in a table. It’s code you should not touch expect that it will run for you.
First start with creating a shortcode or page template to display the form. See for the page templates: http://codex.ww.wp.xz.cn/Page_Templates.
When you want to insert data into a custom database table then you do the following:
$wpdb->insert(
'wp_mytable',
array(
'column1' => 'value1',
'column2' => 123
),
array(
'%s',
'%d'
)
);