1. 21 Jan, 2006 1 commit
  2. 07 Dec, 2005 1 commit
  3. 06 Dec, 2005 1 commit
  4. 29 Nov, 2005 1 commit
  5. 27 Nov, 2005 1 commit
  6. 21 Nov, 2005 1 commit
  7. 04 Nov, 2005 1 commit
  8. 20 Oct, 2005 1 commit
  9. 18 Oct, 2005 1 commit
  10. 29 Aug, 2005 1 commit
  11. 25 Aug, 2005 1 commit
  12. 11 Aug, 2005 1 commit
  13. 30 Jul, 2005 1 commit
  14. 27 Jul, 2005 1 commit
  15. 22 Jun, 2005 1 commit
  16. 23 May, 2005 1 commit
  17. 08 Apr, 2005 1 commit
  18. 07 Jan, 2005 1 commit
  19. 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
  20. 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
  21. 20 Sep, 2004 1 commit
    • Dries's avatar
      · 228b3c7c
      Dries authored
      - Patch #10945 by Adrian: more PostgreSQL fixes/updates.
      228b3c7c
  22. 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
  23. 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
  24. 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
  25. 30 Apr, 2004 1 commit
    • Dries's avatar
      · e4d45aae
      Dries authored
      - Patch by Adrian: added support for multiple database connections.
      e4d45aae
  26. 08 Dec, 2003 1 commit
    • Dries's avatar
      · 3904790e
      Dries authored
      - Tidied up the DoxyGen comments.  Patch by Kjartan.
      3904790e
  27. 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
  28. 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
  29. 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
  30. 10 Jul, 2003 1 commit
    • Dries's avatar
      · 337b3c9d
      Dries authored
      - Committed a slightly modified version of Slavica's table prefix patch.
      337b3c9d
  31. 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
  32. 04 Apr, 2003 1 commit
  33. 03 Apr, 2003 1 commit
    • Dries's avatar
      · 3ab5709a
      Dries authored
      - Changed pconnect() to connect().
      3ab5709a
  34. 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
  35. 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
  36. 06 Nov, 2002 1 commit
  37. 24 Oct, 2002 1 commit
    • Dries's avatar
      · 2512ce76
      Dries authored
      - Killed a warning.  Reported by ax.
      2512ce76
  38. 23 Oct, 2002 1 commit
  39. 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