WordPress Install and Database on separate hosting?

Yes – absolutely. Simply enter the appropriate hostname and credentials in wp-config.php. Instead of the default localhost use the hostname provided by your database provider. Example: define( ‘DB_HOST’, ‘mysql.example.com:3307’ ); https://codex.wordpress.org/Editing_wp-config.php#Set_Database_Host

$wpdb->insert is not working

It sounds like it would be simpler to go back and fix your initial try: saving an option to a WP-native table rather than creating your own. Try update_option – it creates an option if it doesn’t exist, or updates if it does. This will save you a lot of code and headaches in the … Read more

Uppercase to sentence case for post titles

You can do that with a command in your database: UPDATE `wp_posts` /* Adjust the prefix! */ SET `post_title` = CONCAT( UCASE( /* First letter uppercase */ SUBSTRING( `post_title`, 1, 1 ) ), ”, LCASE( /* The rest in lowercase */ SUBSTRING( `post_title`, 2, LENGTH(`post_title`) ) ) ); If your author has a habit of … Read more

Show last modified date of database

There’s an UPDATE_TIME column in the TABLES table in the information_schema database. So you can try to get the max from that column with e.g.: SELECT MAX(`UPDATE_TIME`) FROM information_schema.TABLES WHERE TABLE_SCHEMA = ‘dbname’ where we replace ‘dbname’ with the corresponding database name. More related info here on SO. From the MySQL 5.7 docs: UPDATE_TIME displays … Read more

Creating user relationships

WordPress does provide you with the ability to save meta data for users, so you could just store the agent’s user id in a meta field of his subscribers, like update_user_meta( $user_id, “agent”, $agent_id ). You can then query those users with the WP_User_Query’s meta_query, e.g. $agents_subscribers = new WP_User_Query( array( ‘meta_key’ => ‘agent’, ‘meta_value’ … Read more

Does WordPress always create unique passwords?

Theoretically No! But practically Yes! Every new framework/CMS now implements some sort of library that adds randomness to the actual password. Its a randomly generated salt in form of a random string or time, etc. That is saved along with the hash password in database. Since theoretically, a collision can occur in any cryptographic function … Read more