Location: PHPKode > scripts > ddbb > sample.php
<?php
define('DB_SERVER', 'server_1');
define('DB_USER', 'me_or_you');
define('DB_PASSWORD', '');
define('DB_DATABASE','test');

include_once("./class.ddbb.inc"); //the base class

$oTest = ddbb_sel('mysql', DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE); //connect to DB_SERVER with credentials given in constants
//don't change the first parameter; actually the class only suppport MySQL

$oTest->consulta("SELECT * FROM table"); //execute de query

while($oTest->leeFila()){ //read a row
	echo($oTest->aFila['field']."\n"); //show a field
}

//var_dump($oTest->aTiempos); //show times (conection, consult, ...)

$oTest->desconectar(); //disconnect
?>
Return current item: ddbb