Search
 
SCRIPT & CODE EXAMPLE
 

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;
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: unnamed place placeholders pdo 
Php :: laravel reoute return string 
Php :: twig render string 
Php :: yii2 activeform adding field css class 
Php :: laravel pest assertstatus 
Php :: php foreach multidimensional array recursive 
Php :: to list all relations of model laravel 
Php :: how to close login route in laravel 
Php :: twig filter array 
Php :: php ref parameter 
Php :: what is carriage return in php 
Php :: date in russian php 
Php :: "IlluminateDatabaseEloquentMassAssignmentException" 
Php :: php location header not working 
Php :: @admin @endadmin 
Php :: Error : Call to undefined method IlluminateNotificationsChannelsMailChannel::assertSentTo() 
Php :: php check if stdclass object has property 
Php :: PHP str_ends_with — Checks if a string ends with a given substring 
Php :: get attachment by id wordpress 
Php :: php Undefined index: error 
Php :: bind param php 
Php :: php format phone number with dashes function 
Php :: PHP Iterables 
Php :: php file hash 
Php :: laravel remove controller 
Php :: wp post view 
Php :: extend multiple classes in php 
Php :: laravel collection union 
Php :: if ip is 
Php :: which is file attributes in php 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =