Changing the Database Connection Error Message

Basically, if you create a PHP file named db-error.php and put under /wp-content/, you’ll get what db-error.php will have. Here is my template on CodePen. This is example : <?php header(‘HTTP/1.1 503 Service Temporarily Unavailable’); header(‘Status: 503 Service Temporarily Unavailable’); header(‘Retry-After: 3600’); // 1 hour = 3600 seconds mail(“[email protected]”, “Database Error”, “There is a problem … Read more

Migrating data between local and development server

Assuming your wp-config.php is already in place and in order: Step 1. Mysqldump your development database Step 2. Replace all instances of development.domain.com to production.domain.com^^ Step 3. Login to MySQL, run a SOURCE command to import data e.g. source /path/to/file ^^ How to replace all instances of old domain with new: (1) Copy the script … Read more

what is the wp_5_posts table in the database?

Those are from a multisite install. The numbers represent the blog_id and the tables are created when you add a new site to your network. http://codex.wordpress.org/Database_Description#Multisite_Table_Details http://codex.wordpress.org/Create_A_Network#Step_4:_Installing_a_Network

Display data from a non wordpress database on a page template

As Ben suggested, you need to pass the connection details when creating the wpdb class: $newdb = new wpdb( ‘user’, ‘password’, ‘database’, ‘hostname’ ); You should also test that the query actually returned something before using the result in a foreach loop: if ($rows) { foreach ($rows as $obj) { … } }

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