public function getId($id) { $db = new Database(); $db->connect(); $sql = "select id, fullname from feedback_db where id={$id}"; $db->selectJoin($sql); return $db->getResult(); }
<?php $db = new Database(); $db->connect(); $sql = "select tds_file,msds_file1,msds_file2 from bidding_file"; $db->selectJoin($sql); $rows = $db->getResult(); $data = array(); foreach ($rows as $each) { $rowdata = $each['tds_file'] . "," . ($each['msds_file1'] == '' ? ' NO MSDS' : ' ' . $each['msds_file1']) . ($each['msds_file2'] == '' ? '' : ', ' . $each['msds_file2']); array_push($data, $rowdata); } echo json_encode($data); $db->disconnect(); /*$data = array(); if ($handle = opendir("products")) { while (false !== ($entry = readdir($handle))) { if($entry!='.' && $entry!='..') { //$zip->addFile($file."/".$entry); //echo "$entry<br/>"; array_push($data,$entry); } } closedir($handle); }*/ //echo json_encode($data);