Welcome Guest, Not a member yet? Register   Sign In
ODBC
#2

[eluser]Unknown[/eluser]
I had the same error. after hours and hours i got it work in the following way:

1. go to the system\database\drivers\odbc\odbc_driver.php and comment out the whole function CI_DB_odbc_driver($params) line 51 to line 56 -> this seems to be a bug in the constructor.

2. do not use statements like (foreach $query->result() as $row){ echo $row->ID;} ... use instead (foreach $query->result_array() as $row){ echo $row['ID'];} this works for me.

3. i don't exactly know if there's another mistake within codeigneter or php with odbc. i can't use $query->num_rows(). this always gives back -1 no matter if there's a record selected or not. i use instead a seperate counter like $count = 0; foreach (....){count++;}

hope i could help you, 'cause i was sitting for about 2 days on that problem but now it works.

Chris


Messages In This Thread
ODBC - by El Forum - 09-04-2009, 09:49 AM
ODBC - by El Forum - 10-09-2009, 06:32 AM
ODBC - by El Forum - 01-05-2010, 11:48 PM
ODBC - by El Forum - 01-06-2010, 05:28 AM
ODBC - by El Forum - 05-14-2010, 11:41 AM
ODBC - by El Forum - 06-26-2010, 05:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB