SET @elemType='experience';
SET @lang='it';
SET @=@permalinkType='slug';
SET @imageType='main';
SET @deleted=0;
SELECT
meta_experiences.title,
experience_calendar.tmstp,
FROM_UNIXTIME(experience_calendar.tmstp) as dt,
experience_calendar.id AS calId,
ana_experiences.*,
(SELECT ana_locations.name FROM ana_locations where ana_locations.id=ana_experiences.ana_locations_id) AS location,
#price-----
(
SELECT ana_experiences_details.price
FROM ana_experiences_details
WHERE ana_experiences_details.ana_experiences_id = ana_experiences.id
ORDER BY price DESC LIMIT 1
) AS price,
#permalink----------------------------------------------------
(
SELECT routes.pattern
FROM routes
WHERE routes.id IN
(
SELECT experience_routes.routes_id
FROM experience_routes
WHERE experience_routes.experience_id = ana_experiences.id
AND experience_routes.languages_id=@lang
AND experience_routes.route_type=@permalinkType
)
)
AS permalink,
#image---- -------------------------------------------------------
(
SELECT
concat
(@imageUrl, rel_path,rel_url,file_name)
FROM ana_files
WHERE ana_files.id IN
( SELECT experience_files.ana_files_id
FROM experience_files
WHERE experience_files.ana_experiences_id = ana_experiences.id
AND img_type = @imageType
)
)
AS image
FROM ana_experiences
#slot for date and availability--------------------------------------------------------------
LEFT OUTER JOIN experience_calendar ON ana_experiences.id = experience_calendar.experience_id
AND experience_calendar.id =
(
select experience_calendar.id FROM experience_calendar
WHERE experience_calendar.experience_id= ana_experiences.id
ORDER BY tmstp DESC LIMIT 1
)
#meta for title and des------------------------------------------------------------------------
LEFT OUTER JOIN meta_experiences ON ana_experiences.id = meta_experiences.ana_experiences_id
AND meta_experiences.ana_languages_id=@lang
WHERE
type=@elemType
AND
experience_calendar.id IS NOT NULL
AND
_deleted=@deleted
AND #published language
(
SELECT id
FROM experience_lingue_pubblicate
WHERE experience_lingue_pubblicate.ana_languages_id=@lang
AND experience_lingue_pubblicate.ana_experiences_id=ana_experiences.id
) is not NULL
ORDER BY experience_calendar.tmstp DESC
LIMIT 4
Could you narrow this down to the smallest reproducible example and open a new issue if you're still having this issue. There is too much noise in the details here to really understand what is going.
error Details Type: PDOException Code: HY000 Message: SQLSTATE[HY000]: General error File: /var/development/masi-fase2/web/vendor/j4mie/idiorm/idiorm.php Line: 1913 Trace
0 /var/development/masi-fase2/web/vendor/j4mie/idiorm/idiorm.php(1913): PDOStatement->fetch(2)
1 /var/development/masi-fase2/web/vendor/j4mie/idiorm/idiorm.php(718): ORM->_run()
2 /var/development/masi-fase2/web/vendor/j4mie/idiorm/idiorm.php(707): ORM->_find_many()
3 /var/development/masi-fase2/web/vendor/j4mie/idiorm/idiorm.php(2269): ORM->find_many()
4 /var/development/masi-fase2/web/src/models/experienceModel.php(559): ORM->__call('findMany', Array)
source line $records=\ORM::forTable('ana_experiences')->raw_query($sql)->findMany();
ORM settings
["connection_string"]=> string(33) "mysql:host=xxx.xom;dbname=name" ["id_column"]=> string(2) "id" ["id_column_overrides"]=> array(0) { } ["error_mode"]=> int(2) ["username"]=> string(4) "xxx" ["password"]=> string(18) "xxx" ["driver_options"]=> array(1) { [1002]=> string(14) "SET NAMES utf8" } ["identifier_quote_character"]=> NULL ["limit_clause_style"]=> NULL ["logging"]=> bool(true) ["logger"]=> NULL ["caching"]=> bool(false) ["caching_auto_clear"]=> bool(false) ["return_result_sets"]=> bool(false) }
all the tables are in utf8mb4_general_ci
the query
1 home page items
result from mysql prompt