<?php
/// Filipe Martins														MAISQI.COM [2009-04-06]
///                                                                     http://www.maisqi.com
///
/// I'm trying to demonstrate that 'mysqli_fetch_fields' doesn't retrieve the original view on
/// my setup.
///

$host = 'localhost';
$user = 'root';
$pwd = '36981613';
$db = 'test';

$host = 'bitast';
$user = 'filipe';
$pwd = '123456';
$db = 'test';
/*
$host = 'bitux';
$user = 'test';
$pwd = '123456';
$db = 'test';
*/

$conn = mysqli_connect ($host, $user, $pwd, $db);

$viewName = 'vw_downls_fichs';
?><h1>Querying <?php	echo $viewName;	?>...</h1><?php
$res = mysqli_query ($conn, "SELECT * FROM $viewName");
$flds = mysqli_fetch_fields ($res);
foreach ($flds as $fld)
	echo 'NAME: <strong>' . $fld->name  . '</strong> ORGNAME: <strong>' . $fld->orgname . '</strong> ORGTABLE: <strong>' . $fld->orgtable . '</strong><br />';
mysqli_free_result ($res);


mysqli_close ($conn);
