| Новости | FAQ | Авторы | Документация | В действии | Библиотека |
| Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
KLeN 13.12.2006 18:10 / 13.12.2006 18:13
Несколько упрощенный код но вызывает туже ошибку:@main[]
$response:cache-control[no-store, no-cache]
$response:pragma[no-cache]
$request:charset[UTF-8]
$response:charset[windows-1251]
$response:content-type[
$.value[text/html]
$.charset[$response:charset]
]
$SQL.connect-string[mysql://root:@localhost/mouse?charset=utf8]
^connect[$SQL.connect-string]{
$test[^mGetMessagesByParent[$.parent_id(0)]]
}
$test.dt
# так я составляю запросы,
# ну нравится мне
# и до этого момента сбоев не было
@mGetMessagesByParent[hParams]
$result[
^getSql[
$.names[^hash::create[
$.[forum_message.forum_message_id][id]
$.[forum_message.parent_id][]
$.[forum_message.thread_id][]
$.[forum_message.thread_id][]
$.[forum_message.title][]
$.[forum_message.author][]
$.[forum_message.email][]
$.[DATE_FORMAT(forum_message.dt_published, '%e-%c-%y %H:%i:%s')][dt]
$.[IF(body IS NULL, 1, 0)][is_empty]
]]
$.table[forum_message]
$.where[
is_published = 1
^if(def $hParams.parent_id){AND parent_id = ^hParams.parent_id.int(0)}
]
$.order[dt_published DESC]
]
]
@getSql[hParams]
$result[
^table::sql{
SELECT
^hParams.names.foreach[key;value]{$key ^if(def $value){ AS $value }}[,]
FROM
$hParams.table
^if(def $hParams.where){ WHERE $hParams.where }
^if(def $hParams.order){ORDER BY $hParams.order }
}
]Ошибка: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'1.584513e-305- SELECT forum_message.email ,forum_message.forum_message_id AS id ,forum_message.title ,forum_message.author ,DATE_FORMAT(forum_message.dt_published, '%e-%c-%y %H:%i:%s') AS dt ,forum_message.thread_id ,forum_message.parent_id ,IF(body IS NULL, 1, 0) AS is_empty FROM forum_message WHERE is_published = 1 AND parent_id = 0 ORDER BY dt_published DESC y:/home/test1.ru/www/parser/test.html(44) exception.type=sql.execute sql y:/home/test1.ru/www/parser/test.html(44) getSql y:/home/test1.ru/www/parser/test.html(21) mGetMessagesByParent y:/home/test1.ru/www/parser/test.html(12) connect y:/home/test1.ru/www/parser/test.html(11)Появилась когда я попытался форматировать дату средствами SQL
$.[forum_message.dt_published][dt]на
$.[DATE_FORMAT(forum_message.dt_published, '%e-%c-%y %H:%i:%s')][dt]С чем это может быть связано?