I'm constantly getting a syntax error: Parse error: syntax error, unexpected ';' in feature\process-request.php on line 26. The goal is to create an array that has as keys the result of the first query and as values the related arrays that correspond to the key value. I don't seem to find the problem and am hoping that anyone can assist me exactly on what I have done wrong.
$dbconn = pg_connect("host=localhost port=5432 dbname=postgres user=postgres password=testing") or die("Could not connect");
$fgquery = "SELECT id FROM \"Featuregroup\" order by id ASC";
$result = pg_query($dbconn, $fgquery);
$x=0;
$fglist=array();
while ($row = pg_fetch_array($result)){
array_push($fglist,$row[0]);
print_r($fglist);
echo"<br>";
}
$fgarr=array_fill_keys($fglist,"");
$arrlength=count($fglist);
for($x=0;$x<$arrlength;$x++){
$blockquery= "SELECT id,name FROM \"Block\" WHERE fgid=$fglist[$x] order by name ASC";
print_r ($blockquery);
echo "<br>";
$result2 = pg_query($dbconn, $blockquery);
print_r($result);
$blocklist=array();
$while ($row2 = pg_fetch_row($result2)){
array_push($blocklist,$row2[0]);
}
$fgarr[$fglist[$x]]=$blocklist;
}
print_r ($fgarr);
Thanks in advance for having a look at this. Your help will be greatly appreciated!