1. 27 Nov, 2005 1 commit
  2. 18 Nov, 2005 1 commit
  3. 20 Oct, 2005 1 commit
  4. 18 Oct, 2005 1 commit
  5. 13 Oct, 2005 1 commit
  6. 12 Sep, 2005 1 commit
  7. 29 Aug, 2005 1 commit
  8. 25 Aug, 2005 1 commit
  9. 11 Aug, 2005 1 commit
  10. 30 Jul, 2005 1 commit
  11. 27 Jul, 2005 1 commit
  12. 22 Jun, 2005 1 commit
  13. 23 May, 2005 1 commit
  14. 12 May, 2005 1 commit
  15. 14 Apr, 2005 1 commit
  16. 29 Nov, 2004 1 commit
    • Dries's avatar
      - Patch #13581 by Steven: Db_query() allows a variable amount of parameters so... · 29337ad8
      Dries authored
      - Patch #13581 by Steven: Db_query() allows a variable amount of parameters so you can pass the query arguments in. There is however an alternative syntax: instead of passing the query arguments as function arguments, you can also pass a single array with the query arguments in it. For example the following two statements are equivalent:
      
      db_query($query, $a, $b, $c);
      db_query($query, array($a, $b, $c));
      
      This usage is particularly interesting when the query is constructed dynamically, and the amount of arguments to pass varies. In that case we use the second method to avoid using call_user_func_array(). This behaviour is not documented explicitly, but it is used in several places.
      
      However, db_query_range() and pager_query() do not support this syntax properly, which means there are several pieces of code which still revert to the ugly call_user_func_array() call.
      
      This patch updates db_query_range() and pager_query() so they support the array-passing method. I also added documentation about this method to each of the db functions.
      
      I also cleaned up the code for db_query (it was weird and hard to understand) and moved db_query() and db_queryd() from database.xxxxx.inc to database.inc: it was the same between both mysql and pgsql, as it doesn't do anything database specific. It just prefixes the tables and inserts the arguments. The actual db query is performed in _db_query(), which is still in database.xxxxx.inc.
      
      Finally, I updated several places with the new syntax, and the code is a lot cleaner. For example:
      - array_unshift($params, "SELECT u.* FROM {users} u WHERE $query u.status < 3");
      - $params[] = 0;
      - $params[] = 1;
      - $result = call_user_func_array('db_query_range', $params);
      + $result = db_query_range("SELECT u.* FROM {users} u WHERE $query u.status < 3", $params, 0, 1);
      
      and
      
      - return call_user_func_array('db_query_range', array_merge(array($query), $args, array((int)$pager_from_array[$element], (int)$limit)));
      + return db_query_range($query, $args, (int)$pager_from_array[$element], (int)$limit);
      
      I've tested it on mysql. I didn't alter the actual db behaviour, so pgsql should be okay too.
      
      This patch is important because many people avoid the call_user_func_array() method and put data directly into the db query.  This is very, very bad because the database prefix will be applied to it, and strip out braces. It's also generally bad form as you have to call check_query() yourself.  With the new, documented syntax, there is no more excuse to put data directly in the query.
      29337ad8
  17. 21 Nov, 2004 1 commit
    • Dries's avatar
      · fa978390
      Dries authored
      - Patch 13180 by chx: renamed check_query() to db_escape_string() and implemtented it properly per database backend.
      
        Read the manual for pg_escape_string:  "Use of this function is recommended instead of addslashes()." Or read sqlite_escape_string: "addslashes() should NOT be used to quote your strings for SQLite queries; it will lead to strange results when retrieving your data."
      fa978390
  18. 09 Sep, 2004 1 commit
    • Dries's avatar
      · b84b6e42
      Dries authored
      - Patch #10663 by JonBob: documentation improvements: fixed some typos and improved consistency to the use of Doxygen/api.module commands in the comments.
      b84b6e42
  19. 08 Sep, 2004 1 commit
    • Dries's avatar
      · 7b716e8e
      Dries authored
      - Patch #10622 by Adrian: fixes various PostgreSQL related problems.
      
        1) Menu problems with Postgres (this is a highly critical 1 line fix)
        2) Archive module fails with Postgres
        3) Postgres setup problems - changes to database.pgsql (although i made these changes myself before finding this patch)
        4) Book module fails with Postgres
        5) Postgres problems following creation of a new type of user - which is actually about a taxonomy.module bug.
        6) Creating accregator_item_table in PostgreSQL
        7) Postgres - Polls not displayed on Poll Page
        8) Blog module has sql errors with postgres
      
        This should not affect MySQL users (hopefully).
      7b716e8e
  20. 14 Jul, 2004 1 commit
    • Dries's avatar
      · 63a327db
      Dries authored
      - Patch #9287 by JonBob: made the code style in the three database include files consistent with Drupal standards, and adds a wealth of Doxygen-style comments to aid developers in writing solid database access code using the API.
      63a327db
  21. 30 Apr, 2004 1 commit
    • Dries's avatar
      · e4d45aae
      Dries authored
      - Patch by Adrian: added support for multiple database connections.
      e4d45aae
  22. 08 Dec, 2003 1 commit
    • Dries's avatar
      · 3904790e
      Dries authored
      - Tidied up the DoxyGen comments.  Patch by Kjartan.
      3904790e
  23. 24 Nov, 2003 1 commit
    • Dries's avatar
      Patch by Ax to fixe and improve to the core doxygen PHPdoc: · 06045ff7
      Dries authored
        * fixes all doxygen warnings [#]_ in the current code base
          + changes @param style from phpDocumentor (@param type $var desc) to doxygen (@param $var desc)
          + documents all undocumented parameters
          + escapes / fixes html warnings
          + fixes @defgroup in theme.inc
        * adds more groupings [#]_
          + drupal_{set|get}_title, drupal_{set|get}_breadcrumb
          + pager.inc: pager_api (pager_query(), pager_display()), pager pieces
        * adds a new group "themeable" which contains all themeable functions.
      06045ff7
  24. 22 Oct, 2003 1 commit
    • Dries's avatar
      · 742410aa
      Dries authored
      - Bugfix: prefix not prepended to sequences.  Fixes bug #3639.
      
        Make sure to write:
      
          db_next_id({table}_field);
      
        instead of:
      
          db_next_id(table_field);
      742410aa
  25. 21 Jul, 2003 1 commit
    • Dries's avatar
      · c39562ae
      Dries authored
      - Fixed node_save() and user_save() bug introduced by table prefix changes.
        Modified patches from Gerhard.
      
      - Changed the order of the checks in node_teaser().  Patch from Kobus.
      c39562ae
  26. 10 Jul, 2003 1 commit
    • Dries's avatar
      · 337b3c9d
      Dries authored
      - Committed a slightly modified version of Slavica's table prefix patch.
      337b3c9d
  27. 07 May, 2003 1 commit
    • Dries's avatar
      · a161110a
      Dries authored
      - Applied  Michael Caerwyn's "%s -> %d" patch.
      
      - Changed all occurences of '%d' to %d as suggested on the mailing list.
      a161110a
  28. 04 Apr, 2003 1 commit
  29. 03 Apr, 2003 1 commit
    • Dries's avatar
      · 3ab5709a
      Dries authored
      - Changed pconnect() to connect().
      3ab5709a
  30. 16 Mar, 2003 1 commit
    • Dries's avatar
      Patch by Ax: · b2583b62
      Dries authored
      - db_query_range() in database.mysql.inc wasn't updated to match
        db_query().
      
      - Fixed phpdoc.
      b2583b62
  31. 09 Nov, 2002 2 commits
    • Dries's avatar
      · 3dd7d9b4
      Dries authored
      - Oops.  The db_query_range() query got added twice.
      3dd7d9b4
    • Dries's avatar
      · c93ab2a2
      Dries authored
      - Added a db_query_range function.  Patch by Natrak, slightly modified.
      c93ab2a2
  32. 06 Nov, 2002 1 commit
  33. 24 Oct, 2002 1 commit
    • Dries's avatar
      · 2512ce76
      Dries authored
      - Killed a warning.  Reported by ax.
      2512ce76
  34. 23 Oct, 2002 1 commit
  35. 13 Oct, 2002 1 commit
    • Dries's avatar
      · fcae7030
      Dries authored
      - Committed Jeremy's incarnation of the statistics module.  Last minutes
        changes include:
      
          * a couple of coding style changes, renamed some "stats" into
            "statistics", etc.
      
          * removed the "Who's online" block from the user module.
      
          * added db_affected_rows() to the resp. database abstraction
            layers and made the statistics module use db_affected_rows()
            instead.
      
          * added update logic to "update.php".
      fcae7030
  36. 20 Aug, 2002 1 commit
    • Dries's avatar
      · bfe5b85d
      Dries authored
      - Applied a (modified) version of Marco's SQL sequence patch.
      bfe5b85d
  37. 23 Jun, 2002 1 commit
    • Dries's avatar
      · d1b2125b
      Dries authored
      - Added the improved db_query() function with timings from Marco's sandbox.
      d1b2125b
  38. 22 Apr, 2002 1 commit
    • Kjartan's avatar
      - bug fixes: · de5b9a16
      Kjartan authored
          * fixed mails not being parsed properly.
          * tracker now shows user name when you view your own recent
            comments.
          * link to submission queue now points to the right place.
          * fixed jabber module.
          * theme is now activated when changed.
      - applied Gerhards coding style patch.
      de5b9a16
  39. 20 Apr, 2002 1 commit
    • Dries's avatar
      · 8043cb99
      Dries authored
      - Applied Marco's big patch, including contributions from Moshe:
      
          + Changed the db_query() API.
      
          + Wrapped all links in l(), lm(), la(), ..., drupal_url() functions.
      
          + XHTML-ified some HTML.
      
          + Wrapped a lot of text in the administrative pages in a t()
            function.
      
          + Replaced all $REQUEST_URI/$PATH_INFOs by request_uri().
      
          + Small bugfixes (eg. bug in book_export_html() and clean-ups (eg.
            RSS code).
      
          + Fixed some bugs in the taxonomy module (eg. tree making bug), added
            new functionality (eg. new APIs for use by other modules), included
            Moshe's taxonomy extensions, and some documentation udpates.
      
          + ...
      8043cb99