phpBBHacks.com - phpBB Database Layer - Page 3
Talk sports at SportsForums.net
StatsForums Home   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in
FAQFAQ   SearchSearch   MemberlistMemberlist   TutorialsTutorials   ContactContact Us
Add Us:     MySpace     Facebook     StumbleUpon
Username:    Password:
Remember Me?    
phpBB Database Layer
Goto page Previous  1, 2, 3
BlinkList
del.icio.us
Furl
linkaGoGo
reddit
Simpy
Mister Wong
Yahoo! My Web

Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2: Technical Reference
 See a User Guidelines violation? Please contact us.
Author Message

Thoul
VIP

Joined: 30 Jul 2002
Posts: 17676
Location: USA

PostPosted: September 26th 2003, 3:39 am    Post subject: Reply with quote

sql_fetchfield
sql_fetchfield( string|field, [ int|number [, resource|query_id ] ] )

Code:
// Get username from the 21st row
$field = $db->sql_fetchfield('username', 21, $result);
// Get username in the current row
$field = $db->sql_fetchfield('username');


Returns the content of one field (or table column) from one row in a SQL result set. The parameter field should be the name of the field to be returned. number should be the number of the row from which to return the field. If number is -1 (the default value), the current row will be used. See the special note for information on the query_id parameter.

Using sql_fetchrow to retrieve an entire row instead of a single field is recommended. sql_fetchrow will often be faster and in some cases sql_fetchfield actually calls sql_fetchrow or does the same work anyway. Also, on Oracle databases, the field will be returned entirely in uppercase.

See Also: mssql_result, mssql_fetch_array, mysql_result, OCIExecute, OCIFetch, OCIResult, pg_fetch_array
Back to top
View user's profile Send private message Visit poster's website

Thoul
VIP

Joined: 30 Jul 2002
Posts: 17676
Location: USA

PostPosted: September 26th 2003, 3:40 am    Post subject: Reply with quote

sql_rowseek
sql_rowseek( int|row_number [, resource|query_id ])

Code:
$db->sql_rowseek($offset, $result);


Used to move the internal row pointer of the result associated with query_id to the indicated row number. The next call to sql_fetchrow would return the row to which the internal pointer is moved.

The function will return TRUE unless the row pointer can not be moved to the indicated row, in which case FALSE is returned. See the special note for information on the query_id parameter for another case in which FALSE could be returned.

See Also: mssql_data_seek, mysql_data_seek, OCIExecute, OCIFetch
Back to top
View user's profile Send private message Visit poster's website

Thoul
VIP

Joined: 30 Jul 2002
Posts: 17676
Location: USA

PostPosted: September 26th 2003, 3:42 am    Post subject: Reply with quote

sql_nextid
sql_nextid( [ resource|query_id ] )

Code:
$id_number = $db->sql_nextid();


Returns the id number automatically generated when the previous INSERT query was executed. In MySQL, this is the value of an AUTO_INCREMENT column. sql_nextid should be used after the INSERT query and before any other queries are executed.

See the special note for information on the query_id parameter. Using this parameter is not recommended for this function. It will not be used by the MS Access, MS SQL, MS SQL (ODBC) or MySQL database layers.

Oracle users may encounter errors due to this function being defined twice. If this occurs, the errors may be solved by deleting one copy of the function.

See Also: mysql_insert_id, OCIParse, OCIExecute, OCIFetchInto, pg_exec, pg_fetch_array
Back to top
View user's profile Send private message Visit poster's website

Thoul
VIP

Joined: 30 Jul 2002
Posts: 17676
Location: USA

PostPosted: September 26th 2003, 3:44 am    Post subject: Reply with quote

sql_freeresult
sql_freeresult( [ resource|query_id ] )

Code:
$db->sql_freeresult();
$db->sql_freeresult($result);


This function is used to free all memory associated with an SQL query. See the special note for information on the query_id parameter.

sql_freeresult should be used if you are worried about the memory being used for a query. All memory is freed when a script finishes executing, but sql_freeresult is helpful when dealing with queries that return large result sets.

See Also: odbc_free_result, mssql_free_result, mysql_free_result, OCIFreeStatement, pg_freeresult
Back to top
View user's profile Send private message Visit poster's website

Thoul
VIP

Joined: 30 Jul 2002
Posts: 17676
Location: USA

PostPosted: September 26th 2003, 3:46 am    Post subject: Reply with quote

sql_error
sql_error( [ resource|query_id ] )

Code:
$error = $db->sql_error();
$error = $db->sql_error($result);


Returns an associative array containing information about the last SQL error encountered. This array typically has the following elements:

  • code - An error code generated by the database software. Disabled on MS Access and MS SQL. Always -1 on PostgreSQL.
  • message - The error message returned by the database software. Always "Error" on MS Access.


The function always returns an empty string on the ODBC database layer. See the special note for information on the query_id parameter.

See Also: odbc_error, odbc_errormsg, mssql_get_last_message, mysql_error, mysql_errno, OCIError, pg_errormessage
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2: Technical Reference All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Links: Big Message Boards - Free JavaScript - phpBB2 - phpbb styles - Suporte phpBB - phpBB.it - phpBB Česky - phpBB Turkiye - phpBBArabia.com - phpBB-fr.com - Romanian phpBB online community - phpBB-TW.net - phpBBservice.nl - phpBB Brasil

Network: iFroggy Network Blog - iFroggy Hosting - SportsForums.net - KarateForums.com - YanksBlog.com - PhotoshopForums.com - DeveloperCube - Managing Online Forums - ManagingCommunities.com - CommunityAdmins.com - DrGregHouse.com - Bad Boy Blog - SodaRatings.com - Patrick O'Keefe

< Advertising - Contact Us - Staff - User Guidelines >

Copyright © 2001-2009. iFroggy Network, phpBBHacks.com. All Rights Reserved. Privacy Policy. We Support phpBBHacks.com (of course!).
Powered by phpBB © phpBB Group. phpBB SEO. Hosted by 100MegsWebHosting. We are in no way affiliated with the phpBB Group. phpBB is copyright to the phpBB Group.