尝试仅使用其标题获取某些列,但选择了所有列标题

时间:2016-03-31 16:52:08

标签: php mysql fpdf

require_once("dbcontroller.php");
include('watermark1.php');
$number = $_COOKIE["user"]; 
$db_handle = new DBController();
$result = $db_handle->runQuery("SELECT Employee_number,date_start,date_end,Days_taken,Sick,Study,Annual,compassionate_leave,Other,Details,Status,approved_by FROM leave_management WHERE Employee_Number='$number'");

问题出在这里是因为我不知道如何编写代码只从上面获取所选查询的标题,而是从表中提取所有标题,而不是仅从选定的列标题中提取。关于如何修改$ header代码的任何提示?

$header = $db_handle->runQuery("SELECT `COLUMN_NAME` 
FROM `INFORMATION_SCHEMA`.`COLUMNS` 
WHERE `TABLE_SCHEMA`='Namtax' 
    AND `TABLE_NAME`='leave_management'");

0 个答案:

没有答案