• Resolved patdundee

    (@patdundee)


    Since upgrading to the latest php 5.5.9 and WP 3.92 all custom MYSQL coding has been changed to MYSQLI

    Using MYSQLI you have to refer to the database connection name

    Does anyone know what this is

    $con, $conn, $wpdb or none of these.

    May thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter patdundee

    (@patdundee)

    Hi Guys
    Any takers

    Here is my query string but it is producing no results and it should be

    ‘$results = $wpdb->query(“SELECT County FROM counties”);
    while($row = $results->fetch_assoc()) {
    echo $row[“County”]. “
    ‘;
    }
    $results->free();’

    I’ve answered the first part in your other thread http://wordpress.org/support/topic/mysqli-issue?replies=3

    But, looping wasn’t covered there. You’d use that as:

    $results = $wpdb->get_results ("SELECT Country FROM countries");
    
    foreach ($results as $row) {
        echo $row->Country;
    }

    When you’re uisng the $wpdb functions, remember that you’re not using any mysqli_ functions. Under most circumstances you won’t need to again (unless you’re working outside of WordPress, of course).

    Thread Starter patdundee

    (@patdundee)

    Hi
    Many thanks. I forgot i posted in here also. That has solved the issue.
    Your help is much appreciated
    P 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘What is the WP data connection name’ is closed to new replies.