Random data saved on dropdown

Random data saved on dropdown

si08789si08789 Posts: 15Questions: 6Answers: 0

Dear Allan,

I have been able to create a dropdown on each one of my rows. The idea is to save the value of the selected choice of the dropdown in the table (this value is the iduser) and it works well. But many times it changes the user's lastname (no the firstname) apart from saving the id. I don't know what to do.

The other issue is that I'm not able to put two condition in the where clause of the dropdown. I have tried to put this way but it take just the last value, not both: array('idconfig_users'=>'90','idconfig_users'=>'110')

Could you please guide me?

This is the server side code:

    Field::inst( 'avclasses.iduser' )
        ->options( function () use ( $db ) {

            $userList = $db->select( 'avusers', 'id,firstname, lastname, lastname2',array('idconfig_users'=>'90'), ' lastname ASC' );

            $out = array();

            while ( $row = $userList->fetch() ) {
                $out[] = array(
                    "value" => $row['id'],
                    "label" => $row['firstname'].' '.$row['lastname'].' '.$row['lastname2']
                );
            }

            return $out;
            } ),

Thank you!

Answers

This discussion has been closed.