get_results suddenly not working on a single table
Have you tried placing the query result to a variable? $resultArray = $wpdb->get_results(“SELECT * FROM properties”)
Have you tried placing the query result to a variable? $resultArray = $wpdb->get_results(“SELECT * FROM properties”)
You don’t have to worry about closing connection to you DB because it will be automatically closed when a request will be processed by your server. But if you have to close it, then you can do something like this: @mysql_close( $wpdb->dbh ); Pay attention that it could lead to unexpected results because other plugins … Read more
$current_time = current_time(‘mysql’); $querystr = ” SELECT * FROM {$wpdb->prefix}usermeta WHERE meta_key=’bday_unix’ AND DATE_ADD( from_unixtime(meta_value), INTERVAL YEAR( ‘{$current_time}’ ) – YEAR( from_unixtime( meta_value ) ) YEAR ) BETWEEN ‘{$current_time}’ AND DATE_ADD( ‘{$current_time}’, INTERVAL 30 DAY )”; Should work, I think.
Since your questions are quite vast and not completely WordPress related, I will stick to your main question. The answer is: Yes. As long as you have it in different directories and don’t use the same prefix for their database tables or have a separate database for each (which means you can stuff more than … Read more
When you use $wpdb->prepare the placeholder %s is replaced with something between quotes, so, your query becomes: “SELECT * FROM ‘wp_users’ WHERE ID = 1” but table names in SQL queries must not be wrapped in quotes. So, the right way is: $sql = $wpdb->prepare( “SELECT * FROM {$wpdb->users} WHERE ID = %d”, 1 ); … Read more
you can use this plugin for doing this: phpBB Bridge also you can find more useful description in this stackoverflow Question: How to integrate phpBB with WordPress
If this is in the admin, use the action parameter: <a href=”https://wordpress.stackexchange.com/questions/159391/<?php echo esc_url( admin_url(“?action=delete_ticket&ticket_id=$ticket->ID” ) ?>”>Delete item</a> …and then hook appropriately: function wpse_159391_delete_ticket() { if ( isset( $_GET[‘ticket_id’] ) ) { // delete it! } } add_action( ‘admin_action_delete_ticket’, ‘wpse_159391_delete_ticket’ ); For the front-end, you can just append your parameters to the current url and … Read more
Redirect Issue: WordPress database
Unfortunately, it seems that you have now learned the hard way that you should not: trust only your web hosting company to keep your data intact, or keep your backups on your web server. Sadly, restoring your WordPress installation — if at all possible — will most likely not be easy! You might be able … Read more
After instantinating a wpdb the instace vars holding the table names are still not present. You need to call the set_prefix() method, in order to setup all table names according to your other wordpress table prefix. (Very likely this will be wp_ in your case). $newdb = new wpdb( DB_USER , DB_PASSWORD , DB_NAME , … Read more