<?php
$mydb = new wpdb('uid','passwd','database','localhost');
$mydb->show_errors();
$query = "SELECT DATE_FORMAT(col1, '%d-%b') AS Pdate, DATE_FORMAT(col1, '%Y') AS Pyear, col2, col3, col4, col5 AS fname FROM table ORDER BY col1 DESC LIMIT 50";
$result = $mydb->get_results($query);
echo $mydb->num_rows . ' in table ';
?>
Related Posts:
- How to implement WP_List_Table? WP_List_Table giving array instead of a value in listing table
- How To Make Connection To WordPress Data Base In A Plugin?
- Add value to usermeta without removing previous values?
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Remove one value in dismissed_wp_pointers?
- How to check if a meta value has already been assigned to any user?
- Sum the total amount of a specific product purchased per user and display in table
- Weird 404 URL Problem – domain name being placed at end of urls
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Basic wpdb update question
- Add two or multiple functions in WordPress Post or Page
- Insert double entry in DB
- dbDelta support for FOREIGN KEY
- Cleaning up WordPress to improve performance?
- List of all theme customizer control types?
- How to correctly submit a search form and display the result in an independent page
- Show the most popular post per week
- Add a class to links in the visual editor (how to get old dialog back)
- Creating custom Woocommerce attribute taxonomies from a plugin
- Load post content into iframe
- Does WordPress cache get_user_meta() results?
- wp_customize_image_control default value
- Using Echo in ShortCode – Stuck
- Overriding a theme redux file in child theme
- No wp-config.php file on local install of wordpress – site still displays
- Widgets not showing in my custom theme
- Use ajax to update_post_meta
- How to display custom field on homepage
- Is the outdated PHP mysql extension a requirement for WordPress 4.6?
- What SQL / WordPress queries would need a nonce?
- Different database query in function.php using mysqli
- How to get 2 or multiple custom post types in wordpress functions.php
- Creating bulk posts with Youtube videos
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- create a select input with menus created on a custom options page
- How can I export posts with featured images, without download them
- How to securely provide a $_POST var in WP_Query with PHP 7?
- What is a valid parent for get_terms()?
- Calculating a large number of MYSQL queries as customshort codes, slow
- How to pick the default selected value in wordpress dropdown?
- Customize position of social icons in upme plugin [closed]
- wp query foreach deleting record returning only first or last item
- Media Upload , file name changed automatically
- Replace shortcode in substring
- What exactly do this function declared into functions.php file of a WP theme?
- How to show/hide php table rows based on the content of custom fields
- customize wordpress database error page
- Make a database query using WordPress
- Ajax search shows all results when user empties input?
- List post by title length
- WordPress widget and customize.php not working in Ubuntu16.04 VPS
- Need help with pagination
- Using wordpress function to retrieve data
- form $_post action value gets truncated after it passes through two forms
- Add row to custom database Table and delete all rows older than 1 day
- making php value numeric
- Editor capabilities – admin_init
- WP insert post Redirect after function has executed
- How can I add diffrent editable text fields?
- Please help! I have a problem with getting wordpress databas
- How to run complex query using PHP
- Featured image in menu wordpres
- Conditional formatting on data fetched from MYSQL
- If Statement is Ignored?
- Can I split a huge wp_postmeta table across different databases or servers?
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- WordPress mysql deos not work with php7
- How can i limit the number of posts to the most recent 6 in my query?
- Need help transforming echo to return for use with shortcode
- Noob question: want to remove the “site identity” logo for specific part of website only
- Error inserting into custom table – Object of class wpdb could not be converted to string [closed]
- Redirect after login depending on the URL
- Searching a custom WP table and displaying results in an HTML table
- WP + MySql db / PHP
- The plugin generated 225 characters of unexpected output during activation
- append data to mysql table via submit button coded in php – not working
- WordPress select query issue
- Real time notification on user profile after new comment
- How to do a MySql query in WordPress?
- How to add text before posts
- How to associate dynamic PHP page for chosen WordPress tag?
- Send data from plugin to external database
- WordPress error on my website
- How to set max users to 17.000
- Passed variable gets undefined variable error on insert on next page
- directorypress theme error mysql_error() [closed]
- Best way to define a database with product codes and back-end support?
- wp_customize_image_control default value
- How to add button to top of theme customizer?
- How do I use CSS or PHP to customize WordPress Form Manager Plugin Table?
- How can I add more code to this?
- Edit the Publish Widget Options
- Cannot Upload Custom Header Image into WordPress Dashboard
- echo php values in table – strange behaviour, not all values are shown
- Predefine Magazine Style Layouts
- Parse error: syntax error, unexpected ‘}’ in C:\xampp\htdocs\admin\products.php on line 148 [closed]
- New to WordPress & Freelancing [closed]
- Execute multiple PHP Snippets causes error?
- what to do after instlling cyberpanel on VPS