Error Number 1054 - Unknown column 'text_content_' in 'field list' - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Error Number 1054 - Unknown column 'text_content_' in 'field list' (/showthread.php?tid=50815) |
Error Number 1054 - Unknown column 'text_content_' in 'field list' - El Forum - 04-10-2012 [eluser]yuro[/eluser] hello, The site is not found on Google. It displays the status 500. The following error message appears: Quote:--Database Error-- In the data model_content.php is the programming of this part: Code: public function getContentDatabyId($id) Help please Error Number 1054 - Unknown column 'text_content_' in 'field list' - El Forum - 04-10-2012 [eluser]smilie[/eluser] Well, as MySQL itself said, table: 'text_content_' does not exist. It is also a bit strange to see table ending with _ mostly is this so called table prefix. Only way to solve this is to check in that database, what is correct name of the table. Cheers, Smilie Error Number 1054 - Unknown column 'text_content_' in 'field list' - El Forum - 04-10-2012 [eluser]yuro[/eluser] [quote author="smilie" date="1334056664"] Only way to solve this is to check in that database, what is correct name of the table. [/quote] Thats my database: The table called "content" with the column "content_id", "page_name", "text_content_en", "text_content_de", "text_content_it", "text_content_fr", "banner". The problem is that he should choose a language from these columns. How could I convert it? Error Number 1054 - Unknown column 'text_content_' in 'field list' - El Forum - 04-10-2012 [eluser]smilie[/eluser] Ok, seems that your: Code: $this->session->userdata('web_lang'); is not working as expected. Can you echo just that and see if you have in there what you expect? Cheers, Smilie Error Number 1054 - Unknown column 'text_content_' in 'field list' - El Forum - 04-10-2012 [eluser]yuro[/eluser] frontendcontroler.php : Code: // set default language ac_helper.php : Code: $CI =& get_instance(); thats all! Error Number 1054 - Unknown column 'text_content_' in 'field list' - El Forum - 04-11-2012 [eluser]yuro[/eluser] please help I give you the login information, if you want to look in the php datas. Error Number 1054 - Unknown column 'text_content_' in 'field list' - El Forum - 04-11-2012 [eluser]jvicab[/eluser] The problem seems to be that $this->session->userdata('web_lang') is having nothing, so you should check why. As smilie suggested, check $this->session->userdata('web_lang') first to see why it is not retunrning any value [try var_dump($this->session->userdata('web_lang'));] Error Number 1054 - Unknown column 'text_content_' in 'field list' - El Forum - 04-12-2012 [eluser]yuro[/eluser] Thankssssss it works :-) ..I'm so happy!!! edit: when I go to the website, it is on the upper left side "NULL". why? Error Number 1054 - Unknown column 'text_content_' in 'field list' - El Forum - 04-16-2012 [eluser]yuro[/eluser] hello, my problem is not finished. The columns in the database are existing. But he says that are unknown column. Code: $this->db->select("text_content_".$this->session->userdata('web_lang')." AS text_content, menu.menu_name_".$this->session->userdata('web_lang')." AS menu_name,banner"); What do I have for an alternative maybe? |