Simple form that saves to database

For what I can understand you already have the table in your database. I don’t know how you have named it, but a best practise (for me a must-do practise) is to name it with the same table prefix of wordpress, that’s the one setted in wp-config.php. You also don’t say how this table is … Read more

Can I use MariaDB instead of MySQL in wordpress?

To answer your exact questions: Yes. Just use MariaDB instead of MySQL. No, it is a straight replacement. The exact details depend heavily upon your exact situation. However, MariaDB is marketed as a compatible MySQL replacement. AFAIK, it works with WordPress with no changes at all.

wp_users user_status field

As far as I know it isn’t used, but to avoid conflicts/problems, other plugins might use it, I’d go with adding a meta to the wp_usermeta table. There is a set of functions for handling that: add_user_meta() get_user_meta() update_user_meta() delete_user_meta() Shouldn’t make a big difference for the functionality you want to implement, but you’re on … Read more

Hook into $wpdb

query – you will get sql as argument of the callback. add_filter(‘query’, ‘some_callback_that_change_query’); function some_callback_that_change_query($sql){ remove_filter(‘query’, ‘some_callback_that_change_query’); // your banny wrote add_filter(‘query’, ‘some_callback_that_change_query’); return $sql; }

Inserting data into custom tables

You said your form is in the main folder? I guess you need to set proper URL for action=””. You could try: action=”<?php echo site_url() . ‘/setLiquorType.php’; ?>” It is best practice to put your form code into functions.php and then leave form action=”” empty. Then you can trigger your form function when the form … Read more

Connect forms in WP to external database

You can easily connect to another DB using the wpdb class: $external_users_db = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); (substituting in your applicable values, of course). From there you can use the get_results, insert, update, and query methods (among others) to do what you need to do, e.g. $external_users_db->get_results( “SELECT ID, username FROM users” );. The … Read more

Sharing database for collaborative development

Yes. Use WP_HOME and WP_SITEURL in your wp-config.php, so the URLs in the database won’t mess (a lot) with local site development. define (‘WP_HOME’, ‘http://local/site/url’); define (‘WP_SITEURL’, ‘http://local/site/url’); Also, some other good practices: Put in your .gitignore things like: wp-config.php wp-content/uploads wp-content/cache wp-content … # Everything that is created by users .htaccess Make a copy … Read more