This is a clean installation and I was starting to develop a module.
So I have the following code (and nothing more apart from the hook_menu()):
$result = db_query("SELECT * FROM {variable}");
return db_affected_rows();
I used the variable
table as an example since it was likely to be populated (and it is, of course!). Well, to my surprise db_affected_rows() always returns 0
.
Is there any reason why it doesn't work? Are there any reported bugs that I may have missed?
Setup:
- Drupal 6.22
- PostgreSQL 8.4
- PHP 5.3.8