<?
/* put this class into a file cls/dbconnect.cls */
/************************************************************************/
class Db {
cfunction connect() {
/*connect db class*/
$host = "me.mydomain.com";
$user = "myuser";
$passwd = "mypassword";
$db = "mydb";
mysql_connect($host,$user,$passwd) or die("Sorry, can't connect to SQL server, please come
later...");
@mysql_select_db("$db");
}
/************************************************************************/
cfunction close() {
/*close connection*/
mysql_close();
}
};
?>
<?
/*this is an example of how to use the above class...*/
require("http://me.mydomain.com/cls/dbconnect.cls");
$myDb = new Db;
/*connect to database*/
$myDb->connect();
/*show entire table*/
$qry = "SELECT * FROM foo";
$result=mysql_query($qry) or die("Error: couldn't execute query 1 ($qry)");
/*use your result...*/
/*disconnect*/
$myDb->close();
?>
[PHP5] aDB PDO LIKE Database Abstraction. Switch easily from one db server to another, strong errors management, manage transactions, queries preparation and more. Categories : PHP , PHP Classes , Databases , MS SQL Server , MySQL ADODB Database Wrapper Abstraction Library for PHP: MySQL, MSSQL,
Oracle, Interbase,ODBC, Microsoft Access and FoxPro. Categories : PHP Classes , Databases , PHP , General SQL , ODBC TAB_STRUCT Class: Is supporting Class for the DBXML Class Categories : PHP , PHP Classes , MySQL , XML , Databases MySQL database class Categories : PHP , MySQL , Databases , PHP Classes Specify your connection settings and create a link to a MySQL database. Categories : PHP , PHP Classes , Databases , MySQL , Beginner Guides Mssql database Manager Categories : PHP , Databases , MS SQL Server , Classes and Objects , PHP Classes Recordset Class like ADO Recordset (plus DataBase Splitting feature) using ODBC functions Categories : PHP Classes , ODBC , Databases , PHP Setting up InnoDB on MySQL and using Transactions Begin, Commit, Rollback in PHP. Categories : PHP Classes , Databases , PHP , MySQL , InnoDB Logs hits to any page which includes it. Automatically utilises page access information left behind by PHP/FI2.0. Categories : Databases , PHP , mSQL , Databases SQLite PHP Database Wrapper Categories : PHP , PHP Classes , Databases , SQLite , Beginner Guides Link Manager for Link Exchangers Categories : PHP , PHP Classes , Databases , MySQL , CURL A script to generate a report from a valid mysql connection. The user has to supply which fields he wants to display in table. All properties are changable.
Categories : PHP , PHP Classes , Databases , MySQL , HTML and PHP Simple database class Categories : PHP , PHP Classes , MySQL , Databases Ajax PHP Tree (Left and Right) with MySQL Categories : PHP , Databases , MySQL , AJAX , PHP Classes YellowPages Content Grabber (PHP5 +) Categories : PHP , PHP Classes , Regexps , Databases , MySQL