1
How do I print this SQL query on the screen in string form?
$current_user = wp_get_current_user();
$resultado = $wpdb->get_results( "SELECT meta_value FROM $wpdb->usermeta WHERE user_id = '$current_user->ID' AND meta_key = '_jm_candidate_field_clocknow_user_btn'" );
This query is returning the following result:
Array ( [0] => stdClass Object ( [meta_value] => value_1 ) )
I’d like you to just show the value value_1
.
echo $resultado[0]->meta_value
– rray
Thanks rray! Funfo :)
– Rodrigo Fontes
What if I want to check the $result on an IF. Example: if ( $result == value 1) { do one thing } Else { do another thing }. How do I do it? I’m a beginner in PHP.
– Rodrigo Fontes
It’s the same thing.
– rray