CodeIgniter Forums
working with table that name containing space characters - 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: working with table that name containing space characters (/showthread.php?tid=52577)



working with table that name containing space characters - El Forum - 06-17-2012

[eluser]Unknown[/eluser]
Hi, all

I am working with the trunk version of CodeIgniter. It seems that it can not work with tables that containing space characters. Anybody tried that?

I have filed a issure https://github.com/EllisLab/CodeIgniter/issues/1452 there.


working with table that name containing space characters - El Forum - 06-17-2012

[eluser]jmadsen[/eluser]
what sort of table are you using that you have a space in the name?

Any normal database will treat that as <name> <table_alias>

I think you have issues with your understanding of databases? Please at least tell us the details of what database you are using, and a sample query


working with table that name containing space characters - El Forum - 06-17-2012

[eluser]Unknown[/eluser]
i.e. If My table name is "Test Table",
Code:
$this->db->count_all("Test Table");
the last query will be
Code:
SELECT COUNT(*) AS `numrows` FROM `Test` `Table`
But it should be
Code:
SELECT COUNT(*) AS `numrows` FROM `Test Table`

Thanks for your help


working with table that name containing space characters - El Forum - 06-17-2012

[eluser]jmadsen[/eluser]
sorry, I understand what you are saying now.

you should follow up on narfbg's fix, or push a bug fix of your own since you had a proposed solution


working with table that name containing space characters - El Forum - 06-17-2012

[eluser]InsiteFX[/eluser]
Code:
&nbsp;