We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Retrieve value question for a user | Forum

Fred
Fred Jan 28 '15
Hello, How to retrieve the checked values ​​questions to a user? For example, I have a question with checkbox in the database , the stored values ​​are the sum of all values ​​of the answers ...
Fred
Fred Jan 28 '15

I found this code

<?php

$data = array();

$multicheckboxValue = (int)3;


for ( $i = 0; $i < 31; $i++ )

{

    $val = (int) pow(2, $i);


    if ( $val & $multicheckboxValue )

    {

        $data[] = $val;

    }

}

echo "<pre>";

print_r($data);

?>


which retrieves the values ​​of the checkbox from the database in value, against how to find users who value ,example, the value 1 AND 4 AND the value 256 ?

The Forum post is edited by Fred Jan 28 '15