Welcome Guest, Not a member yet? Register   Sign In
Pagination problems
#11

[eluser]Bramme[/eluser]
Could be me, but aren't you supposed to use num_rows(), the function with an underscore, instead off numrows the variable.
#12

[eluser]buckboru[/eluser]
Well it doesn't seem that i need num_rows the function, but i did have to change numrows to NUMROWS. I think this might have something to do with DB2. I know when in my views when i display a field from a file, it has to be uppercase.

Now the next problem. DB2 doesn't have a limit clause. So in the db2c_driver.php script, instead it uses
return $sql." RETURN FIRST " . $limit . " ROWS ONLY";

This doesn't work either. I changed to

return $sql."FETCH FIRST " . $limit . " ROWS ONLY";

This sort of works. I can now get my first page of records correctly. However, there doesn't seem to be a mechanism to get additional rows, because offset is not used.

Now that said, i sort know a solution, I'm just not sure the best way to implement it within CI

If i do something like this

"SELECT * FROM (select row_number() over (order by last_name) as rn, id, last_name, first_name,department,extension,pager,cellphone#,userimage
from $table) x where rn between " . $fromrow . " and " . $torow;

I think it will work, but i don't really know how i should implement it.

the _limit function receives the $sql which comes in as select * from tstmis.phoned01.

Any suggestions will be greatly appreciated.




Theme © iAndrew 2016 - Forum software by © MyBB