Weird WP -Cli Error Connection Refused

For anyone else who comes across this post… the above issue was caused by the w3-total-cache plugin being migrated between Test and Staging servers. To fix the issue, I deactivate and exclude w3-total-cache tables from the Test server’s db export, then I do the upload and import to Staging server, which has its own “local” … Read more

Merge meta_value’s into a single row and then loop

It would appear simply un-serialising works: $results = $wpdb->get_results( $sql_str ); foreach($results as &$result) { $result-> my_custom_meta_values = unserialize($result-> my_custom_meta_values); } If anyone can suggest a more efficient way to do this, I’d be interested.

Get count of rows based if column exists in two different tables

You need to use a join in your mysql query. Something like this might get you closer… global $wpdb; $rsvp_table = $wpdb->prefix . ‘rsvp’; $invites_table = $wpdb->prefix . ‘invites’; $sql=”SELECT COUNT(*) as count FROM $invites_table i1 JOIN $rsvp_table r1 ON (r1.reference = i1.reference)”; $yet_to_respond = $wpdb->get_results( $sql ); echo $yet_to_respond->count;

Can’t send form data to wpdb when URL has query string

I see a few issues with the code: First, the form action is not set correctly. It should be something like: <form action=”<?php echo esc_url( get_the_permalink() ); ?>” method=”post”> In the PHP code, you are using the wrong table name. You are using the table name ‘invites’ instead of ‘rsvp’. You should change this line: … Read more

How to use orderby on meta_value when using Pods custom database table storage

As with any custom tables in your database, you can override the SQL that WP_Query ends up using. For this use case, I’d suggest not using WP_Query’s arguments and building your own function to do this instead as it could simplify the logic and complexity. <?php add_filter( ‘posts_clauses’, ‘my_custom_wp_query_posts_clauses’, 10, 2 ); /** * Custom … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)