Part of the EllisLab Network
   
 
Error with $this->db->list_fields() when using mysql/mysqli
Posted: 06 July 2008 04:41 PM   [ Ignore ]  
Grad Student
Rank
Total Posts:  44
Joined  05-04-2006

When I use the db function list_fields on a table with dashes the tablename is not escaped and the query fails.

$this->db->list_fields('table-with-dashes');

results in the following query:

SHOW COLUMNS FROM table-with-dashes


which fails.

Expected query:

SHOW COLUMNS FROM `table-with-dashes`

This happens with CodeIgniter 1.6.3 and using bot mysql and mysqli db drivers.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 62402 Total Logged-in Users: 31
Total Topics: 76628 Total Anonymous Users: 2
Total Replies: 413860 Total Guests: 413
Total Posts: 490488    
Members ( View Memberlist )