The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Поиск:  Каталог документации

Next Previous Contents

22. Appendix J phpDBTest.php3 Example

Submitted by: Joe Thong Site URL:

Description: A PHP database wrapper for various database servers with a powerful Recordset for result data manipulation. Database results are flushed automatically by phpDB.

To get this file, in the web-browser, save this file as 'Text' type as phpDB-mssql.lib

< head>
        < title>Untitled< /title>
< /head>

< body>
        // Assumed this file is placed in the same directory with
        $db = new phpDB();
        $db->pconnect("hostName", "userName", "passWord", "databaseName") or die ("Can't connect to database server or select database");
        $rs = $db->execute("SELECT * FROM Items");
        $numOfRows = $rs->getNumOfRows();
        echo "Number of Rows: $numOfRows";      

        $rs->firstRow(); // optional, but recommended
        while (!$rs->EOF) {
                // Fields collection accessible as associative arrays too
                echo "<br>" . $rs->fields[0];
                $rs->nextRow(); // NOTE: nextRow() is placed at below

        $db->close();   // optional
< /body>
< /html>

Next Previous Contents

Inferno Solutions
Hosting by

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру