Next Tutorial
Drupal 7 Tutorial Part 16: Drupal 7 Reports & Logs Explained
Drupal theme pager not working
Hi ,
Today i found one strange bug with drupal 6 pager_query implementation. When i write part of sql query in small letters like
$result = pager_query("SELECT * from {table1} where placementid = %d", 10, $pager_num, NULL, $vid);
and calling theme('pager', NULL, 10, $pager_num); pager is failed to print.
But writing like this
$result = pager_query("SELECT * FROM {table1} where placementid = %d", 10, $pager_num, NULL, $vid);
and calling theme('pager', NULL, 10, $pager_num); pager is displayed. This is due to case sensitivity of "FROM" in sql query.
Cheers,
Anil Sagar
©2010 AnilSagar. All rights reserved. Drupal theme by Kiwi Themes.

3 comments
pretty weird but true!
That's true, that happens to me also, I placed FROM in capital letters and the pager worked, with lowletters it did not create the page.
Awesome thanks for the tip :),
Luis
capital letter worked for me also
capital letter worked for me also, I have to capitalized SELECT FROM and WHERE then pager appears
I had found something like
I had found something like that..But we may not be able to call that a bug...
$result = pager_query(" SELECT * from {table1} where placementid = %d", 10, $pager_num, NULL, $vid);
This will also not print. Ever wonder why? Look for space before SELECT..
Since it uses pattern matching, this is an issue.. Hope this helps some one...
Thanks
Vikram Y