PHP Classes

File: examples_database.php

Recommend this page to a friend!
  Classes of Sven Wagener   database class   examples_database.php   Download  
File: examples_database.php
Role: Example script
Content type: text/plain
Description: Example file for database class
Class: database class
mSQL,MS SQL,MySQL,ODBC,Postgre,Sybase DB Layer
Author: By
Last change: Added example ODBC connect
Date: 19 years ago
Size: 586 bytes


Class file image Download


// Connecting to database
$db=new database("mysql","localhost","addresses","username","password");

// Switching to debug mode

// Making query
$db->query("SELECT * FROM addresses");

// Counting results and showing it
echo $db->count_rows();

// Printing results

* Connecting ODBC database

// Connecting to odbc database
$db=new database("odbc","","","","",false,"odbc-name-of-db");