Welcome Guest, Not a member yet? Register   Sign In
Weird in 1.72
#1

[eluser]kodai[/eluser]
I used this code before in SVN 1.62 and run well but in 1.72 run with error

Code:
$this->db->select('tbl_menu.ID_MENU, concat(repeat("    ",length(MENU_PATH)/4),tbl_menu.MENU_NAME) as MENU_NAME2,ID_MENU_PARENT,MENU_PATH,SEQUENCE_NUMBER,MENU_URL,MENU_TYPE,STATUS_ACTIVE,MENU_NAME');
$this->db->from("tbl_menu");
$this->db->orderby('concat(MENU_PATH,if(ID_MENU>999,"",if(ID_MENU>99,"0",if(ID_MENU>9,"00","000"))),ID_MENU)');
$this->db->orderby('ID_MENU_PARENT','ASC');
$this->db->orderby('MENU_PATH','ASC');


Quote:A Database Error Occurred
Error Number: 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 'FROM (`tbl_menu`) ORDER BY concat(MENU_PATH, if(ID_MENU>999, `""`, if(ID_MENU>99' at line 2

SELECT `tbl_menu`.`ID_MENU`, concat(repeat(" ", length(MENU_PATH)/4), `tbl_menu`.`MENU_NAME)` as MENU_NAME2, `ID_MENU_PARENT`, `MENU_PATH`, `SEQUENCE_NUMBER`, `MENU_URL`, `MENU_TYPE`, `STATUS_ACTIVE`, `MENU_NAME` FROM (`tbl_menu`) ORDER BY concat(MENU_PATH, if(ID_MENU>999, `""`, if(ID_MENU>99, `"0"`, if(ID_MENU>9, `"00"`, `"000")))`, `ID_MENU)`, `ID_MENU_PARENT` ASC, `MENU_PATH` ASC

Probably someone can help to investigate it? Thanks Smile


Messages In This Thread
Weird in 1.72 - by El Forum - 11-19-2009, 04:18 AM
Weird in 1.72 - by El Forum - 11-19-2009, 04:37 AM
Weird in 1.72 - by El Forum - 11-19-2009, 05:23 AM
Weird in 1.72 - by El Forum - 11-19-2009, 05:28 AM
Weird in 1.72 - by El Forum - 11-20-2009, 03:53 PM
Weird in 1.72 - by El Forum - 11-20-2009, 04:32 PM
Weird in 1.72 - by El Forum - 11-20-2009, 06:11 PM
Weird in 1.72 - by El Forum - 11-23-2009, 06:26 PM
Weird in 1.72 - by El Forum - 12-07-2009, 09:27 AM
Weird in 1.72 - by El Forum - 12-08-2009, 04:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB