I am trying to get all values from database column, using wp get_col().
It seems missing something, here is my query
global $wpdb;
$table_name = $wpdb->prefix . 'students';
$results = $wpdb->get_col("SELECT * FROM $table_name WHERE groups = ''");
print_r($results);
//Output Array ( [0] => 24 [1] => 25 [2] => 26 [3] => 27 [4] => 28 [5] => 29 )
I want my query to print the values( name of the groups)
How can I correct this?
question from:
https://stackoverflow.com/questions/65840054/how-to-use-get-col 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…