简体   繁体   中英

PHP/MYSQL What am i doing wrong

So i need help with some stuff. In that photo bellow, "Kompanijos savininkas" should display "last name, name" of all users in the opened list. Every user_id has different color. So the name should be colored by the color which the code is. But i am doing something wrong because only color code is showing not the colored name. Here is the photo and codes which i changed. Help please.

在此处输入图片说明

// collect all the users for the company owner list
$q = new DBQuery;
$q->addTable('users','u');
$q->addTable('contacts','con');
$q->addQuery('user_id');
$q->addQuery('user_color');
$q->addQuery('CONCAT_WS(", ",contact_last_name,contact_first_name)'); 
$q->addOrder('contact_last_name');
$q->addWhere('u.user_contact = con.contact_id');
$owners = $q->loadHashList();

    <tr>
        <td align="right"><?php echo $AppUI->_('Kompanijos savininkas'); ?>:</td>
        <td>
    <?php
echo arraySelect($owners, 'company_owner', 'size="1" class="text" style="color:"$user_color"', 
                 ((@$obj->company_owner) ? $obj->company_owner : $AppUI->user_id));
    ?>
        </td>
    </tr>
 <?php
echo arraySelect($owners, 'company_owner', 'size="1" class="text" style="color:'.$user_color.';"', 
                 ((@$obj->company_owner) ? $obj->company_owner : $AppUI->user_id));
    ?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM