I have a report designed by Report Designer. It is a "Printable report". If the button position is "on the repord page", "menu:more actions" and "button: print", everything is well.
But if the button position is "Menu: with selected", it gives the following error.
Code: Select all
Database Error: 1064 - 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 'and FROM_UNIXTIME(e.field_826, '%Y-%m-%d') = '' order by urun_grubu, urun_c' at line 18
Query: select FROM_UNIXTIME(e.field_826,'%d.%m.%Y') as tespit_tarihi, FROM_UNIXTIME((select g.field_817 from app_entity_60 g where g.id = e.parent_item_id), '%d.%m.%Y') as giris_tarihi, (select j.field_918 from app_entity_68 j where j.id = (select i.field_816 from app_entity_60 i where i.id = e.parent_item_id)) as arac, (select h.field_777 from app_entity_62 h where h.id = e.field_825) as urun_grubu, (select l.field_785 from app_entity_63 l where l.id = e.field_793) as urun_cesidi, (select m.field_864 from app_entity_65 m where m.id = e.field_822) as birimi, e.field_794 as miktar, e.field_1068 as birim_fiyat, e.field_800 as tutar, e.field_1225 as hizmet_bedeli from app_entity_64 e where e.field_821 = and FROM_UNIXTIME(e.field_826, '%Y-%m-%d') = '' order by urun_grubu, urun_cesidi
Page: /index.php?module=items/report_page_print_selected&path=84&report_id=27
#0 includes/functions/database.php(87): mysqli_query()
#1 plugins/ext/classes/report_page/blocks_php.php(42) : eval()'d code(24): db_query()
#2 plugins/ext/classes/report_page/blocks_php.php(42): eval()
#3 plugins/ext/classes/report_page/blocks_html.php(70): report_page\blocks_php->render()
#4 plugins/ext/classes/report_page/report.php(69): report_page\blocks_html->render()
#5 modules/items/actions/report_page_print_selected.php(37): report_page\report->get_html()
#6 index.php(20): require('m...')
#7 {main}
Code: Select all
$info_query = db_query("select field_1261 as satici, FROM_UNIXTIME(field_1260, '%Y-%m-%d') as tarih from app_entity_84 where id='[current_item_id]'");
$info = db_fetch_array($info_query);
$satici = $info['satici'];
$tarih = $info['tarih'];