User Login    
 + Register
  • Main navigation
Vote for XOOPS!!!!
Login
Username:

Password:


Lost Password?

Register now!
Documentation
Who's Online
82 user(s) are online (2 user(s) are browsing XoopsWiki)

Members: 0
Guests: 82

more...
[Main Page]

Dev:XoopsDB

From XOOPS Project

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy
Category: Development

Definition

$xoopsDB is the XOOPS-wide database object, used to execute SQL queries in the database. It can also be retrieved through Database::getInstance();

Usage

Important methods are:

   query() - execute a query. Note that if the request method is GET, this method will only accept SELECT queries. Returns a database resultset
   queryF() - force an execution of a query without regard to request method. USE WITH CAUTION!!!
   getRowsNum($resultset) - returns number of rows in a resultset
   getAffectedRows() - returns number of rows changed by a query
   getInsertId() - returns the auto_increment id of the latest insertion query
   fetchRow($resultset) - returns an array of values from a row, indexed by number ($row0?, $row1? etc.)
   fetchArray($resultset) - returns an array of values from a row, indexed by fieldname ($row'field1'?, $row'field2'? etc.)
   quoteString($string) - ensures that a string is inserted in the database with proper quotes to avoid e.g. SQL injection


Back to Main Page

Retrieved from "http://www.xoops.org/modules/mediawiki/index.php/Dev:XoopsDB"

This page has been accessed 369 times. This page was last modified 02:01, 16 December 2007. Content is available under XOOPS Project.


Local Support Sites
Powered by
XOOPS Code hosted on SourceForge

Powered by PHP



Powered by MySQL

Powered by Smarty

OSI certified

All content on this site is subject to the Creative Commons License
Developers for Hire