Hi guys...
I'm trying to combine the results of two arrays:
But it doesn't work.
I'd like it to show me something like this:
first cf_id -> 100
second cf_id -> 90
third cf_id -> 80
etc...
Could you help me understand what's wrong?
I'm trying to combine the results of two arrays:
<?php
// first array
$points = array(100, 90, 80);
// second array
$db =& JFactory::getDBO();
$query = "
SELECT `cf_id`,
FROM `#__chronoforms_my_table`
WHERE `check2` != '' AND `radio0` = 'M' AND `cat_cerchi` = 'D' AND `rifiuto_cerchi` = ''AND `edizione_anno` = '$anno_impostato'
ORDER BY somma_pts_cerchi DESC, date_int ASC
LIMIT 10
";
$db->setQuery($query);
$result = $db->loadObjectlist();
// combine the arrays
$result_2 = array_combine ($result, $points);
foreach($result_2 as $k=>$v){ echo $k.' -> '.$v.'<br />'; }
?>
But it doesn't work.
I'd like it to show me something like this:
first cf_id -> 100
second cf_id -> 90
third cf_id -> 80
etc...
Could you help me understand what's wrong?