Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
API page: http://api.drupal.org/api/drupal/includes%21database.mysql-common.inc/fu...
The return values listed on the page do not include TRUE, whilst (at least using mysqli) a successful INSERT query will make db_query() return a boolean TRUE.
Comment | File | Size | Author |
---|---|---|---|
#9 | 1441852-return_value-9.patch | 661 bytes | chris.leversuch |
#5 | 1441852-return_value-5.patch | 924 bytes | chris.leversuch |
#3 | 1441852-return_value.patch | 627 bytes | chris.leversuch |
Comments
Comment #1
mdupontThis is what PHP official documentation says:
Comment #2
jhodgdonSounds like something that needs to be updated in the documentation - thanks!
Comment #3
chris.leversuch CreditAttribution: chris.leversuch commentedSomething like this?
I assume this doesn't need fixing in D8 or D7 since the database system changed a lot.
Comment #4
jhodgdonI don't think "resultset" is a word, even though the official PHP documentation apparently uses it? Also, maybe we should give examples of which queries return result sets, like the PHP docs in #2 do?
And yes, this is drupal 6 only.
Comment #5
chris.leversuch CreditAttribution: chris.leversuch commentedIs this better?
Comment #6
jhodgdonThat looks better! I am wondering if we can combine the mysql and mysqli parts?
Also, our style guidelines in the Drupal project require a , before the final or in a list:
apples, oranges, or bananas
Comment #7
chris.leversuch CreditAttribution: chris.leversuch commentedThe PHP docs area slightly different for mysql/mysqli - mysql has "and other statements returning resultset" after the list of query types. I guess it could be that they're actually the same and the PHP docs are misleading.
Should I remove the distinction between the 2 and just say "Successful SELECT, SHOW, DESCRIBE, EXPLAIN, or other queries which return a set of results will return a database query result resource" ?
Comment #8
jhodgdonThat seems like a good idea to me (combining as you suggest).
Comment #9
chris.leversuch CreditAttribution: chris.leversuch commentedAttached.
Comment #10
jhodgdonThat looks good to me, thanks!
Comment #11
Gábor HojtsyThanks, committed, pushed.