You should not use mysql_fetch_array()
Use wordpress built-in functions, like this:
$SQL = "SELECT * FROM pt_country ORDER BY name";
$rows = $wpdb->get_results( $SQL );
foreach($rows as $r){
print_r($r);
}
Related Posts:
- How to return number of found rows from SELECT query
- Can i use php sql functions instead of $wpdb?
- $wpdb->delete column values IN ARRAY()?
- Custom query to get post names beginning with a digit
- WordPress get pagination on wpdb get_results
- Ajax $wpdb not returning table data
- Converting MYSQL to WordPress $WPDB
- Why is variable not working on custom sql query using wpdb?
- Show MySQL errors that occur when I excute $wpdb->insert()
- Can’t get wp_insert_post to work
- WSoD being caused by this piece of code
- I want to select the from values from database in WordPress? [closed]
- Update results, Before deleting the related category [closed]
- wp query foreach deleting record returning only first or last item
- Database query works fine outside WordPress
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- $wpdb->insert() does not Insert record in a table
- Help with a $wpdb MySQL Query
- Custom array from a query only write the last row of the query
- $wpdb returns duplicate posts
- Mixing variables into an array when inserting values
- Use $wpdb or other PHP script method to find/replace in WP database
- How can I add a new row in a separate database when someone registers via WordPress?
- Basic wpdb update question
- I can’t update my data through $wpdb
- Output: “Array”
- How to use mysql LIKE with wpdb?
- How do I prepare strings for insertions as values into a MySQL table?
- How to use AJAX in WordPress in MYSQL query?
- form $_post action value gets truncated after it passes through two forms
- Why won’t this wpdb get_results query return results?
- WPDB secure custom form
- Add row to custom database Table and delete all rows older than 1 day
- select a single val though a table in wordpress
- Query the links Database
- MySQL Query Returns Array () In Shortcode
- Passing in MySQL prepare statement parameter separately throwing error
- Convert a column of a table containing an Array as response in HTML
- Database SQL query error
- MYSQL TIMESTAMP when adding DATE_FORMAT then the output is blank, PHP conflict?
- Conditional formatting on data fetched from MYSQL
- What is the correct way to search 3 custom fields only in WordPress?
- Using wpdb to connect to a different database is not working
- Rewrite SQL query as a prepared statement and use in foreach loop
- Advanced WordPress SQL Query
- MySQL query in WordPress with AJAX
- Passed variable gets undefined variable error on insert on next page
- MySQL queries in WordPress
- Using the same shortcode to show any table from the database
- MySQL database migration to WordPress
- Error resetting database index using ALTER TABLE in $wpdb->query
- Putting form result in my database
- How can I update a value of a field depending on outside source?
- How to validate WordPress generated password in DB using PHP?
- wpdb::prepare was called incorrectly
- How To Make Connection To WordPress Data Base In A Plugin?
- How to track a users progress through pages by inserting data into WordPress Database?
- the_author_meta not working
- PHP syntax error when using wpdb update?
- “The plugin generated 2694 characters of unexpected output…” on Plugin activation, CREATE TABLE sql command not working
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- mysqli_real_connect() – authentication method unknown to the client Warnings
- Do I need to prepare query before get_results(), get_row() and get_var()?
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Get stock by custom meta field on all Woocommerce variable products
- Display fields as values in array from external SQL DB
- Getting id of poll from WP database
- User management system similar to wordpress one?
- SQL Injection blocked by firewall
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- Long running queries
- Not connecting to database in file with multiple MySQL connections
- Way to bulk make all my tags lowercase?
- $Wpdb post meta query is not working with mutliple meta keys and values? [closed]
- php include not working in custom page
- email alert for product availability
- wpdb Cannot Update column in Database
- add category to posts with tag wordpress
- How can I Use 2 databases with one WordPress install
- WPDB – Read and write value from / to database
- How to Generate a list of Most Commented post?
- Most viewed posts in WordPress
- WordPress get last inserted user id
- What’s wrong in my PHP code? I’m using WordPress Astra Theme and I can’t insert data into my SQL
- Get mysql data for Quick Edit panel
- Change upload URL by mime type
- Unexpected behavior when trying to manually install WordPress on macOS Sierra
- WordPress post insertion from PHP file
- How to return count of items found in SQL query
- Include a custom field in mysql query
- Insert double entry in DB
- Splitting One Big WordPress Site into Multiple Small Sites
- How to edit the default database of WordPress [closed]
- Execute multiple PHP Snippets causes error?
- use wpdb object on other file
- Warning: Undefined property: wpdb::$question_overview in C:\Wamp.NET\sites\proxyvragenmodule\wordpress\wp-includes\class-wpdb.php
- what to do after instlling cyberpanel on VPS
- WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax [closed]
- Updates applied to staging WordPress site affecting production even with different databases
- WordPress Query with meta_key and order by another meta_key