<?php require "connect.inc.php"; // get all one column and print them in a table if ($db->query("SELECT name FROM users")) { $res = $db->getColumn(); echo DBHelper::dumpColumn($res, true, 'name'); echo '<br>'; echo DBHelper::dumpColumn($res, false, 'name'); } else { echo $db->error; } require "disconnect.inc.php"; //////////////////////////////////////////////////////////////////////// echo '<hr>'; highlight_file(__FILE__);
#$smarty->template_dir = "./templates/"; #$smarty->compile_dir = "../templates_c/"; /*$filePath = '.'; $serverPath = $_SERVER['PHP_SELF']; $filePath .= $serverPath; #$prgm = ( $_GET[ 'prgm' ] ) ? $_GET[ 'prgm' ] : "ehmis-home"; if( is_file( $filePath ) ) require_once( "{$filePath}" ); */ # Getting active Hospital Unit Info #$query = "SHOW TABLES "; if ($db->query("SELECT * FROM ehmis_health_unit_main WHERE active = 'Yes' ")) { $result = $db->getNext(); echo DBHelper::dumpColumn($result, true, 'unit_no'); if (isset($result)) { echo 'fadfasd'; } print_r($result); } else { echo $db->error . 'SQL ERROR'; } #$tables = $db->getTables() or die ('No Tables'); #print_r($tables); /*if ( count($result) == 1){ foreach ($result as $unitInfo){ $unit_no = $unitInfo['unit_no']; $unit_name = $unitInfo['unit_name']; $unit_code = $unitInfo['unit_code']; $district = $unitInfo['district'];
echo 'getNext(ANYDB_RES_BOTH): ' . $query; echo '<br>'; echo DBHelper::dumpNext($db->getNext(ANYDB_RES_BOTH), true); echo '<br>'; echo $db->error; echo '<br>'; echo DBHelper::dumpNext($db->getNext(ANYDB_RES_BOTH), true); echo '<br>'; echo $db->error; echo '<hr>'; // get a column $query = "select {$tableKey} from {$table} where {$tableKey}<10"; $db->query($query); echo 'getColumn(): ' . $query; echo '<br>'; echo DBHelper::dumpColumn($db->getColumn(), true); echo '<br>'; echo $db->error; echo '<hr>'; // show widget echo 'new PageWidget() :'; echo '<br>'; $p = new PageWidget($db, $limitFunction, $table, $pageLimit); echo '<br>'; echo $p->getPageDropDown(); echo DBHelper::dumpAll($p->get()); $prev = $p->getPrevLink(); $next = $p->getNextLink(); echo ($prev ? $prev : 'Previous') . ' - ' . ($next ? $next : 'Next'); echo '<p>'; echo $p->getIndex();