PTM Logo Version 0.5.1 Beta
Home    SVN    Downloads    Documentation    Forum    Contact
This Site is 100%
Powered by PTM

SourceForge.net Logo
Documentation
I   Index
II   GNU GPL
III   Description
IV   Installation
V   Language Overview
VI   Tags
VII   Variables
VIII   Functions
IX   Modules
  PTMDB
      • db_add_row()
      • db_add_row_hash()
      • db_create_database()
      • db_create_table()
      • db_connect()
      • db_disconnect()
      • db_delete_row()
      • db_delete_row_like()
      • db_delete_row_where()
      • db_drop_database()
      • db_drop_table()
      • db_get_column_count()
      • db_get_column_stats()
      • db_get_columns()
      • db_get_databases()
      • db_get_index_stats()
      • db_get_indexes()
      • db_get_process_stats()
      • db_get_row()
      • db_get_row_count()
      • db_get_row_count_like()
      • db_get_row_count_where()
      • db_get_row_hash()
      • db_get_row_hash_like()
      • db_get_row_hash_where()
      • db_get_row_hashes()
      • db_get_row_hashes_like()
      • db_get_row_hashes_where()
      • db_get_row_like()
      • db_get_row_where()
      • db_get_rows()
      • db_get_rows_like()
      • db_get_rows_where()
      • db_get_table_stats()
      • db_get_tables()
      • db_select_database()
      • db_query()
      • db_update_row()
      • db_update_row_hash()
      • db_update_row_hash_like()
      • db_update_row_hash_where()
      • db_update_row_like()
      • db_update_row_where()
  RSS20
Documentation
View / Download this file.
---------------------------------------------
PTMDB MODULE - db_update_row_where() FUNCTION
---------------------------------------------

  ------------
  USAGE FORMAT
  ------------

    Where $ret is a return value of 1 or 0 (zero):

    $ret = &db_update_row_where($db_object, $table, $where, @change_values);
    $ret = &db_update_row_where($db_object, $table, $where, $v1, $v2, ... );

  -----------
  DESCRIPTION
  -----------

    Updates a given database table row using a WHERE comparison match.
    ALL ROW VALUES MUST BE PROVIDED IN @change_values OR EMPTIES WILL BE CLEARED
    Returns 1 if successful
    Returns 0 (zero) if not successful

  ---------
  ARGUMENTS
  ---------

    $db_object

      REQUIRED

      A database handler object. This object stores connection information and
      is returned from a db_connect() function call. This object is of the same
      type as is returned by a DBI->connect function call.

    $table

      REQUIRED

      The name of the table in which you would like to update row information.

    $where

      REQUIRED

      Any SQL "WHERE" statement to be used as part of the "UPDATE" statement.
      e.g. "((`column1` = 'value1') AND (`column2` = 'value2'))"

    @change_values

      REQUIRED

      A list of the values (in proper column order) you would like to change in
      the table row. This may be either a Perl @array or simply a comma
      separated list of values.

      ALL ROW VALUES MUST BE PROVIDED OR EMPTIES WILL BE CLEARED.

  -------
  RETURNS
  -------

    1 if row was updated successfully
    0 (zero) if row was not updated successfully or no row matches were found.

  --------------
  USAGE EXAMPLES
  --------------

    ------------------------------------------------------------------------
    Example 1: Update an 'id','name' Row in 'MyTable' with a WHERE Statement
    ------------------------------------------------------------------------

      <?
        $ret = &db_update_row_where($dbobj, 'MyTable',
          "((`id` = '10') AND (`name` LIKE 'j%'))",
          '10', 'John');
      ?>

  --------
  SEE ALSO
  --------

    MODULES

      PTMDB

    FUNCTIONS

      PTMDB - db_connect()
      PTMDB - db_update_row()
      PTMDB - db_update_row_hash_where()
      PTMDB - db_update_row_like()
Home    SVN    Downloads    Documentation    Forum    Contact