Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wpdb get column

//To make it simple, let's assume you have a column called first_name, 
//this is how to get the first_name column from the database.

function get_data( $token ){
    global $wpdb;
    $wpdb->show_errors();
    $result = $wpdb->get_results('SELECT first_name FROM your_table_name WHERE  token =''.$token.'' ORDER BY id DESC');

    foreach ($result as $key => $value) {
        echo $data = $value->first_name;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #wpdb #column
ADD COMMENT
Topic
Name
7+3 =