Color in an SQL query

Asked

Viewed 273 times

-2

I would like to put one with in an SQL query for example:

wp_usermeta.meta_key = 'first_name' or wp_usermeta.meta_key ='last_name'

I’d like to put red here 'last_name' it is possible?

Follow the code of the full consultation:

$sql = ("select DISTINCT ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." userid, (select REPLACE(Group_concat(wp_usermeta.meta_value),',',' ') as full_name from wp_users left join wp_usermeta on wp_users.ID = wp_usermeta.user_id where (wp_usermeta.meta_key = 'first_name' or wp_usermeta.meta_key ='last_name') and wp_users.ID = userid) username, ".TABLE_PREFIX.DB_USERTABLE.".user_nicename link, wp_usermeta.meta_value avatar, cometchat_status.lastactivity lastactivity, cometchat_status.status, cometchat_status.message, cometchat_status.isdevice from ".TABLE_PREFIX.DB_USERTABLE." left join wp_usermeta on ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." = wp_usermeta.user_id left join cometchat_status on ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." = cometchat_status.userid ".$offlinecondition." and (wp_usermeta.meta_key = 'user_avatar' ) order by username asc");
  • 1

    I don’t understand, want to color your PHP code is this?

  • If you want to put color it is not in the query that should do it but in PHP / HTML

  • This put in php

1 answer

1


In the HTML tag you are showing the result, just put the color: red property in the style. For example, let’s say the tag that displays the value is a <td> of a <table>:

<td style="color:red;">

Browser other questions tagged

You are not signed in. Login or sign up in order to post.