From: khartlage Date: Fri, 4 Apr 2003 18:58:07 +0000 (+0000) Subject: Added some mysql function description X-Git-Url: http://git.phpeclipse.com?hp=0d113f2d5a36fb0ec6388bc042cf21bef0224196 Added some mysql function description --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpsyntax.xml b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpsyntax.xml index 342cf52..3824b20 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpsyntax.xml +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpsyntax.xml @@ -1336,56 +1336,142 @@ Directory class with properties, handle and class and methods read, rewind and c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +mysql_affected_rows() returns the number of rows affected by the last INSERT, +UPDATE or DELETE query associated with link_identifier. +If the link identifier isn't specified, the last link opened by mysql_connect() is assumed. + +Note: If you are using transactions, you need to call mysql_affected_rows() +after your INSERT, UPDATE, or DELETE query, not after the commit. + +If the last query was a DELETE query with no WHERE clause, +all of the records will have been deleted from the table but this function will return zero. + +Note: When using UPDATE, MySQL will not update columns where the new value is the same as the old value. +This creates the possiblity that mysql_affected_rows() may not actually equal the number of rows matched, +only the number of rows that were literally affected by the query. + +mysql_affected_rows() does not work with SELECT statements; only on statements which modify records. +To retrieve the number of rows returned by a SELECT, use mysql_num_rows(). + +If the last query failed, this function will return -1. + + + + + + + + +Returns TRUE on success or FALSE on failure. + +mysql_drop_db() attempts to drop (remove) an entire database from the server +associated with the specified link identifier. + +For downward compatibility mysql_dropdb() can also be used. This is deprecated, however. + +Note: The function mysql_drop_db() is deprecated. +It is preferable to use mysql_query() to issue a SQL DROP DATABASE statement instead. + + +Returns the error number from the last MySQL function, or 0 (zero) if no error occurred. + +Errors coming back from the MySQL database backend no longer issue warnings. +Instead, use mysql_errno() to retrieve the error code. +Note that this function only returns the error code from the most recently executed +MySQL function (not including mysql_error() and mysql_errno()), so if you want to use it, +make sure you check the value before calling another MySQL function. + + +Returns the error text from the last MySQL function, or '' (the empty string) if no error occurred. + +Errors coming back from the MySQL database backend no longer issue warnings. +Instead, use mysql_error() to retrieve the error text. +Note that this function only returns the error text from the most recently +executed MySQL function (not including mysql_error() and mysql_errno()), +so if you want to use it, make sure you check the value before calling another MySQL function. + + + +Returns an array that corresponds to the fetched row, or FALSE if there are no more rows. + +mysql_fetch_array() is an extended version of mysql_fetch_row(). +In addition to storing the data in the numeric indices of the result array, +it also stores the data in associative indices, using the field names as keys. + +If two or more columns of the result have the same field names, +the last column will take precedence. To access the other column(s) of the same name, +you must use the numeric index of the column or make an alias for the column. +For aliased columns, you cannot access the contents with the original column name. + + +Returns an associative array that corresponds to the fetched row, or FALSE if there are no more rows. + +mysql_fetch_assoc() is equivalent to calling mysql_fetch_array() with MYSQL_ASSOC +for the optional second parameter. It only returns an associative array. +This is the way mysql_fetch_array() originally worked. +If you need the numeric indices as well as the associative, use mysql_fetch_array(). + +If two or more columns of the result have the same field names, the last column will take precedence. +To access the other column(s) of the same name, you either need to access the result +with numeric indices by using mysql_fetch_row() or add alias names. + +An important thing to note is that using mysql_fetch_assoc() is not significantly slower +than using mysql_fetch_row(), while it provides a significant added value. + + +Returns an object containing field information. + +mysql_fetch_field() can be used in order to obtain information about fields in a certain query result. +If the field offset isn't specified, the next field that wasn't yet retrieved by mysql_fetch_field() +is retrieved. + +The properties of the object are: +name - column name +table - name of the table the column belongs to +max_length - maximum length of the column +not_null - 1 if the column cannot be NULL +primary_key - 1 if the column is a primary key +unique_key - 1 if the column is a unique key +multiple_key - 1 if the column is a non-unique key +numeric - 1 if the column is numeric +blob - 1 if the column is a BLOB +type - the type of the column +unsigned - 1 if the column is unsigned +zerofill - 1 if the column is zero-filled + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mysql_query() sends a query to the currently active database on the server that's associated with the specified link identifier.