WordPress.org

Ready to get started?Download WordPress

Forums

Do wordpress support Oracle 10g or 8i (7 posts)

  1. varandani
    Member
    Posted 4 years ago #

    Hi All

    I am a newbie in WordPress.I have to start an application in WordPress but before i start i am confused whether it supports Oracle or not.Pl assist me that is WordPress having inbuilt compatibility to execute oracle functions or any easy driver support is available on wordpress.

    Pl assist me ASAP

    Thanks in Advance

    Regards
    Mahendra

  2. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 4 years ago #

    No it doesn't support oracle

    you need MySQL 4.1.2 or greater

    http://wordpress.org/about/requirements/

  3. Tom
    Member
    Posted 4 years ago #

    I wonder as Oracle have now bought sun if this will ever happen!

  4. MichaelH
    Member
    Posted 4 years ago #

    And Oracle also owns MySQL (kind of).

    But here's an article that has some info though not necessarily Oracle: Using_Alternative_Databases

  5. Tibor Paulsch
    Member
    Posted 4 years ago #

    It depends on what you plan on doing; to run WordPress I would stick with MySQL, but since PHP can talk with Oracle through OCI8, you can use this function to make a connection, do a query and show the results (example uses the Resources schema that comes with Oracle Express):

    function MyOracleConnection ()
    
    {
    $conn = oci_connect('hr', 'tester', 'localhost/XE');
    if (!$conn) {
        $e = oci_error();
        trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
    	}
    	else	{
    	echo '<p>Congrats: Oracle meets WordPress!</p>';
    }
    
    // Prepare the statement
    $stid = oci_parse($conn, 'SELECT * FROM departments');
    if (!$stid) {
        $e = oci_error($conn);
        trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
    }
    
    // Perform the logic of the query
    $r = oci_execute($stid);
    if (!$r) {
        $e = oci_error($stid);
        trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
    }
    
    // Fetch the results of the query
    print "<table border='1'>\n";
    while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
        print "<tr>\n";
        foreach ($row as $item) {
            print "    <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : "&nbsp;") . "</td>\n";
        }
        print "</tr>\n";
    }
    print "</table>\n";
    
    oci_free_statement($stid);
    oci_close($conn);
    }

    You can then use this function in your WordPress template to do the magic.

    You can read more about the use of OCI8 here:
    http://php.net/manual/en/book.oci8.php

  6. MichaellR
    Member
    Posted 3 years ago #

    Tibor,

    You do that magic?

  7. Flaviac
    Member
    Posted 3 years ago #

    Tibor, you helped me so much =D
    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic