url - PHP : How to set array Value with $_GET -


i tried set value of $_get[] array object

this code

$x=array( 'status_1'=>'"'.$_get['hasil_1'].'"', 'status_2'=>'"'.$_get['hasil_2'].'"', 'status_3'=>'"'.$_get['hasil_3'].'"', . . 'status_17'=>'"'.$_get['hasil_17'].'"');  //faktor klasifikasi $n = 'derajat';  //nama tabel $table='tabel';  classify($x,$n,$table); 

it's not working .

this url

http://localhost:8080/tugas/sispak/hasil.php?hasil_1=1&hasil_2=1&hasil_3=1&hasil_4=1&hasil_5=1&hasil_6=0&hasil_7=1&hasil_8=1&hasil_9=0&hasil_10=1&hasil_11=1&hasil_12=1&hasil_13=1&hasil_14=1&hasil_15=1&hasil_16=1&hasil_17=1 

but , if write manualy like

$y=array( 'status_1'=>'1', 'status_2'=>'1', 'status_3'=>'1',  . . 'status_17'=>'1' ); 

it works !!

this handle values of array

//var_dump($allclass);     foreach($allclass $c=>$p)     {         foreach($x $x=>$y)         {             $i = mysql_query("select count(*) num ".$table." ".$n."='".$c."' , ".$x."='".$y."'");             $j = mysql_fetch_array($i,mysql_assoc);              $p[$c][$x] = round($j["num"]/$allclass[$c],2);      //exception: p(data/class) might 0 in cases, ignore 0             if($p[$c][$x] != 0)                 $argmax[$c] *= $p[$c][$x];         }         $argmax[$c] *= $pc[$c];     } 

somebody me ,please

you dont need quotes, try follows:

$x = array(     'status_1'=> $_get['hasil_1'],     'status_2'=> $_get['hasil_2'],     'status_3'=> $_get['hasil_3'] ); 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -