Results 1 to 6 of 6

Thread: What are the PHP Data Objects?

  1. #1
    Join Date
    May 2009
    Posts
    543

    What are the PHP Data Objects?

    Hello friends,
    I have started PHP programming language before couple of months. I have done the basic programs in PHP. Now I want to know about the data objects that are present in PHP. So thought that there would be someone over there, who might be interested in helping me. So please tell me what are the PHP Data Objects? Hope that you got my point.!! Please help me soon.!!

  2. #2
    Join Date
    Mar 2008
    Posts
    349

    Re: What are the PHP Data Objects?

    The PHP Data Objects (PDO) extension defines a lightweight interface to access a database from PHP. Each pilot database implements the PDO interface can use specific features of each database using extensions functions. You will have to keep in mind that you can not perform any function database using the PDO extension by itself, you must use a specific PDO driver to the database server to access the database. PDO provides an abstraction layer to the data access, which means that you use the same functions to issue queries and fetch data or the database used. PDO does not provide an abstraction of database: it does not rewrite SQL or emulate missing features. You should use a full-blown abstraction if you need it.

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: What are the PHP Data Objects?

    PDO ships with PHP 5.1 and is available as a PECL extension for PHP 5.0; PDO requires the new OO features in PHP 5 and therefore, does not work with earlier versions of PHP. These functions are available in the standard PHP module, which is always available. PDO and the driver PDO_SQLITE are enabled by default since PHP 5.1.0. You must enable the PDO driver for the database of your choice, see the documentation for the drivers specific to your database for more information. Note that at compile PDO as shared extension (not recommended), then all PDO drivers must be loaded after loading PDP.

  4. #4
    Join Date
    Oct 2005
    Posts
    2,393

    Re: What are the PHP Data Objects?

    When installing PDO as shared module, php.ini must be updated to PDO extension loaded automatically when PHP comes into operation. You also need to enable drivers specific to your database, make sure that these drivers will be listed after the line pdo.so, as PDO must be initialized before loading the extensions specific to databases. If you compile and PDO extensions for database statically, you can skip the following step :
    • extension = pdo.so

    If you are using the Windows, PDO and all the major drivers ship with PHP as shared extensions, and simply need to be activated by editing the php.ini file :
    • extension = php_pdo.dll

  5. #5
    Join Date
    May 2008
    Posts
    2,389

    Re: What are the PHP Data Objects?

    The following are the predefined constants :
    • PDO:: PARAM_BOOL (integer) - Represents the data type boolean.
    • PDO:: PARAM_NULL (integer) - Represents the data type of SQL NULL.
    • PDO:: PARAM_INT (integer) - Represents the data type INTEGER SQL.
    • PDO:: PARAM_STR (integer) - Represents the data types CHAR, VARCHAR, or other types of data in a SQL string.
    • PDO:: PARAM_STMT (integer) - Represents a type of game results. Not currently supported by all drivers.

  6. #6
    Join Date
    Jul 2006
    Posts
    442

    Re: What are the PHP Data Objects?

    PDO uses class constants since PHP 5.1. Older versions use global constants in the form PDO_PARAM_BOOL. The following are some more predefined constants :
    • PDO:: PARAM_INPUT_OUTPUT (integer) - Specifies that the parameter is an INOUT parameter for a stored procedure. You must use the OR operator with a data type explicit PDO:: PARAM_ *.
    • PDO:: FETCH_NAMED (integer) - Specifies that the fetch method shall return each row as an array indexed by column name as returned in the corresponding result set. If the result set contains multiple columns with the same name, PDO:: FETCH_NAMED returns an array of values per column name.
    • PDO:: FETCH_NUM (integer) - Specifies that the fetch method shall return each row as an array indexed by column number as returned in the corresponding result set, starting at 0.
    • PDO:: FETCH_OBJ (integer) - Specifies that the fetch method shall return each row as an object with property names corresponding to the column names as returned in the result set.
    "When they give you ruled paper, write the other way..." J.R.J.

Similar Threads

  1. What are objects and classes in C++?
    By Tionontati in forum Software Development
    Replies: 3
    Last Post: 28-12-2010, 08:46 AM
  2. Objects in JSP and JavaBeans
    By Isabella in forum Software Development
    Replies: 3
    Last Post: 27-07-2010, 01:01 PM
  3. C# using DAO (Data Access Objects)
    By Pragnya in forum Software Development
    Replies: 2
    Last Post: 09-06-2009, 01:31 PM
  4. Microsoft ActiveX Data Objects 2.0 Library
    By Simpson in forum Software Development
    Replies: 2
    Last Post: 14-05-2009, 09:43 PM
  5. ActiveX Data Objects
    By fastrod in forum Software Development
    Replies: 3
    Last Post: 04-03-2009, 12:53 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,105,491.56112 seconds with 16 queries