Location: PHPKode > scripts > Access Data Object > access-data-object/index.php
<?php
	require_once('postgres.php');
	$banco = new postgres;
	$res = $banco->query("select nome from tb_categoria order by nome");
	while ($linha = $banco->to_array($res)) {
		echo $linha["nome"]."<br>";
	}
	echo $banco->num_rows($res)."<br>";
	echo $banco->num_fields($res)."<br>";
	

	echo "<br>";
	echo "Métodos da classe postgres.php";
	echo "<br>";	
	$class_methods = get_class_methods(get_class($banco));
	foreach ($class_methods as $method_name) {
		echo "$method_name<br>";
	}

	echo "<br>";
	echo "<hr>";
	echo "<br>";

	require_once('sqlserver.php');
	$banco = new sqlserver;
	$res = $banco->query("select Nome_Funcionario as nome,Guerra_Funcionario as guerra from Funcionario order by Guerra_Funcionario");
	while ($linha = $banco->to_array($res)) {
		echo $linha["guerra"] . "||" . $linha["nome"]."<br>";
	}
	echo $banco->num_rows($res)."<br>";
	echo $banco->num_fields($res)."<br>";
	
	echo "<br>";
	echo "Métodos da classe sqlserver.php";
	echo "<br>";	
	$class_methods = get_class_methods(get_class($banco));
	foreach ($class_methods as $method_name) {
		echo "$method_name<br>";
	}		

	echo "<br>";
	echo "<hr>";
	echo "<br>";

	require_once('mysql.php');
	$banco = new mysql;
	$res = $banco->query("select dsc_modelo, cor_modelo from tb_modelos order by id_modelo");
	while ($linha = $banco->to_array($res)) {
		echo $linha["cor_modelo"] . " || " . $linha["dsc_modelo"]."<br>";
	}
	echo $banco->num_rows($res)."<br>";
	echo $banco->num_fields($res)."<br>";
	
	echo "<br>";
	echo "Métodos da classe mysql.php";
	echo "<br>";	
	$class_methods = get_class_methods(get_class($banco));
	foreach ($class_methods as $method_name) {
		echo "$method_name<br>";
	}		

	echo "<br>";
	echo "<hr>";
	echo "<br>";
	
	require_once('odbc.php');
	$banco = new odbc;
	$res = $banco->query("select nome from tb_categoria order by nome");
	while ($linha = $banco->to_array($res)) {
		echo $linha["nome"]."<br>";
	}
	echo $banco->num_rows($res)."<br>";
	echo $banco->num_fields($res)."<br>";
	echo "<br>";
	echo "Métodos da classe odbc.php";
	echo "<br>";	
	$class_methods = get_class_methods(get_class($banco));
	foreach ($class_methods as $method_name) {
		echo "$method_name<br>";
	}

?>
Return current item: Access Data Object