What generates these very slow postmeta queries? [closed]
The problem turned out to be a Lightbox plugin: Simple Lightbox. I used another plugin: Query Monitor to find it, as suggested in the comments by Jacob.
The problem turned out to be a Lightbox plugin: Simple Lightbox. I used another plugin: Query Monitor to find it, as suggested in the comments by Jacob.
I was able to get a working connection using the following code: function test_connect_to_db() { $servername=”thedatabase.0000000000.location-1.rds.amazonaws.com”; $username=”username”; $password = ‘password’; $dbname=”database”; // Create connection $conn = new mysqli( $servername, $username, $password, $dbname ); // Check connection if ( $conn->connect_error ) { die( ‘Connection failed: ‘ . $conn->connect_error ); } $sql=”SELECT id, firstname, lastname FROM table”; … Read more
You’re inserting a float into market_cap, which is of bigint type. Doesn’t seem to be the thing that would cause the issue in this case, but you might want to use intval() instead of floatval() or change the field to one that’ll handle a float.
This is potentially a fairly involved question, so I may not be totally rigorous in my answer, but this should give you a good start when creating and deleting tables.. Include the following lines in your plugin _construct() function of class_my_plugin.php: if (is_admin()){ //manage the the database tables when registering or deactivating register_activation_hook($loc, array($this, ‘your_plugin_installation’)); … Read more
$wpdb->get_results() only returns arrays( associative or numeric) or an object. It does not return a string value. If you want a string value, you need to use $wpdb->get_var() instead
User roles are not stored in wp_user table. They are stored as User Metadata. In wp_usermeta you can find two rows for every user: <prefix>capabilities (for example wp_capabilities) which contains serialized array of roles assigned to that user <prefix>user_level (for example wp_user_level) which contains level of given user. It’s important to remember, that keys for … Read more
I’m not entirely sure if that’s what you wanted, but… Here’s the code that will register a shortcode, which will get given row and output all the fields of it: function shortcode_db_row_cb( $atts ) { $atts = shortcode_atts( array( ‘id’ => false, ), $atts, ‘db_row’ ); global $wpdb; $row = $wpdb->get_row( $wpdb->prepare( “select * from … Read more
The database password is not stored in the database itself, so importing the database via phpmyadmin will not also import the password. You need to manually edit your local copy of wp-config.php, and enter your local username and password for MySQL ( or any other database you are using ). Usually the default username for … Read more
They are definitely some sort of post – postmeta alone doesn’t show up in the post listing screens like this. The fastest way to delete them would be to go to Screen Options to show more of the posts at once (say 500 per page so it doesn’t time out) and use bulk actions to … Read more
No, there is no need to sanitize passwords. You don’t want to strip out or rewrite a value on users’ set passwords. They will be hashed afterwards, so no need