Hello community. Last week i've asked here a question and GreyHead helped me alot. I've solved that problem.
Now, i have another little problem. I have this query:
$query = "
SELECT Distinct
`I31`.`codmod`,
`I31`.`desmod`
FROM `IDAT2410F` AS I24
LEFT JOIN `IDAT3200F` AS I32
ON `I32`.`CODALL` = `I24`.`CODALL`
LEFT JOIN `IDAT3100F` AS I31
ON `I31`.`CODMAR` = `I32`.`CODMAR` AND `I31`.`CODMOD` = `I32`.`CODMOD`
WHERE
`I24`.`ANNOXX` BETWEEN '".$an2."' and '".$an."'
AND `I32`.`codmar` = '".$marca."'
ORDER BY `I31`.`desmod`";
$db->setQuery($query);
I have order by at his end, but it dosen't work. I don't know how to manage this situation... what i have to do to make it work?
Now, i have another little problem. I have this query:
$query = "
SELECT Distinct
`I31`.`codmod`,
`I31`.`desmod`
FROM `IDAT2410F` AS I24
LEFT JOIN `IDAT3200F` AS I32
ON `I32`.`CODALL` = `I24`.`CODALL`
LEFT JOIN `IDAT3100F` AS I31
ON `I31`.`CODMAR` = `I32`.`CODMAR` AND `I31`.`CODMOD` = `I32`.`CODMOD`
WHERE
`I24`.`ANNOXX` BETWEEN '".$an2."' and '".$an."'
AND `I32`.`codmar` = '".$marca."'
ORDER BY `I31`.`desmod`";
$db->setQuery($query);
I have order by at his end, but it dosen't work. I don't know how to manage this situation... what i have to do to make it work?
Hi myky2k1,
The query looks OK to me, you can echo it out, or add a debugger to see the query that has been built and test that in PHPMyAdmin to see what error that shows.
Bob
The query looks OK to me, you can echo it out, or add a debugger to see the query that has been built and test that in PHPMyAdmin to see what error that shows.
Bob
The query works flawless. But i pass the data with json_encode($options) and in the dropdown, are ordered by key, not by value.
This topic is locked and no more replies can be posted.