Q: How to pull data from custom table to populate zustomizer setting/control select options

So i think I’ve found the answer to my own question. I modified the code in the original tablequerytest.php which queries the custom table and stores results from this: <?php global $wpdb; //Accessing WP Database (non-WP Table) use code below. $results = $wpdb->get_results(‘SELECT alias FROM wp_revslider_sliders’); foreach ($results as $result) { $revchoices = array(“text” => … Read more

Create table from array with prepare

I tried this in local, and I think you have multiple fields inside $fields so I’ve added them in array. Just look at the code below; it works fine as tested: add_action(‘your_hook’, ‘createTableFromFields’); function createTableFromFields($tablename) { $wpdb = $this->db; $tablename = $wpdb->prefix . $tablename; $fields = array(‘PersonID’,’LastName’); $sql=”CREATE TABLE IF NOT EXISTS %s (id INT(6) … Read more

How to display user_nicename and usermeta values by custom query in WordPress?

To do that with WordPress functions, you can try that $users = get_users(); ?> <table> <tr> <th>Customer Name</th> <th>Customer Details</th> </tr> <?php foreach ($users as $u) {?> <tr> <td> <?php echo htmlspecialchars($u->display_name);?> </td> <td> <?php echo htmlspecialchars($u->description); // retrieve the meta “description”?> </td> </tr> <?php }?> </table> <?php

How to extract specific post

As noted in the documentation meta_value, when not used inside a meta query, needs to be a string. Normally if you want to query based on multiple meta values you need to add a meta_query argument. But also as noted in the documentation regarding value: It can be an array only when compare is ‘IN’, … Read more

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