Weird in 1.72 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Weird in 1.72 (/showthread.php?tid=24771) |
Weird in 1.72 - El Forum - 11-19-2009 [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'); Quote:A Database Error Occurred Probably someone can help to investigate it? Thanks Weird in 1.72 - El Forum - 11-19-2009 [eluser]rogierb[/eluser] Your query gets escaped automatically in 1.7.2. Code: `”“` Try using single quotes. Weird in 1.72 - El Forum - 11-19-2009 [eluser]kodai[/eluser] [quote author="rogierb" date="1258648638"]Your query gets escaped automatically in 1.7.2. Code: `”“` Try using single quotes.[/quote] I have try, but still, can you show me which that i must change to single quotes? THanks Weird in 1.72 - El Forum - 11-19-2009 [eluser]rogierb[/eluser] Code: $this->db->orderby('concat(MENU_PATH,if(ID_MENU>999,"",if(ID_MENU>99,"0",if(ID_MENU>9,"00","000"))),ID_MENU)'); into Code: $this->db->orderby("concat(MENU_PATH,if(ID_MENU>999,'',if(ID_MENU>99,'0',if(ID_MENU>9,'00','000'))),ID_MENU)"); And the other parts aswell if they give you any trouble. Weird in 1.72 - El Forum - 11-20-2009 [eluser]kodai[/eluser] Quote:A Database Error Occurred This the last error , i have try also to change 0 with repeat(char(48),x) but still error. Weird in 1.72 - El Forum - 11-20-2009 [eluser]aptereket[/eluser] don't use quotes ` Weird in 1.72 - El Forum - 11-20-2009 [eluser]kodai[/eluser] I have spend 2 days for this kind of problem, seem bugs in database class Thanks Weird in 1.72 - El Forum - 11-23-2009 [eluser]kodai[/eluser] [quote author="aptereket" date="1258777930"]don't use quotes `[/quote] please copy paste this code and run it $this->db->orderby("concat(MENU_PATH,if(ID_MENU>999,'',if(ID_MENU>99,'0',if(ID_MENU>9,'00','000'))),ID_MENU)"); then you will know what the problem is Weird in 1.72 - El Forum - 12-07-2009 [eluser]kodai[/eluser] [quote author="kodai" date="1259043968"][quote author="aptereket" date="1258777930"]don't use quotes `[/quote] please copy paste this code and run it $this->db->orderby("concat(MENU_PATH,if(ID_MENU>999,'',if(ID_MENU>99,'0',if(ID_MENU>9,'00','000'))),ID_MENU)"); then you will know what the problem is [/quote] Still the same error : Thanks for your help, but please create the table and try your self : Code: CREATE TABLE "tbl_menu" ( Weird in 1.72 - El Forum - 12-08-2009 [eluser]InsiteFX[/eluser] You should be escaping the fields not using quotes, also you did not specify the database engine type and the charset. Code: CREATE TABLE `tbl_menu` ( Enjoy InsiteFX |