'.__('You don\'t have enough privileges to access this area!').''); } // Make some functions for writing out an excel file. These functions do some hex writing and to be honest I got // them from some where else but hey it works so I am not going to question it just reuse if (isset($_SESSION["xlsquery"])) { $q = $_SESSION["xlsquery"]; $dbtable = $_SESSION["tblout"]; $qr = $dbs->query($q); if (!$qr) { echo "Could not successfully run query ($q) from DB: " . mysql_error(); exit; } $filename = "excelfilename"; //File Name $file_ending = "xls"; //header info for browser header("Content-Type: application/xls"); header("Content-Disposition: attachment; filename=$dbtable.xls"); header("Pragma: no-cache"); header("Expires: 0"); /*******Start of Formatting for Excel*******/ //define separator (defines columns in excel & tabs in word) $sep = "\t"; //tabbed character //start of printing column names as names of MySQL fields $columns = $qr->fetch_fields(); foreach ($columns as $val) { echo $val->name . "\t"; } print("\n"); //end of printing column names //start while loop to get data while($row = $qr->fetch_row()) { $schema_insert = ""; for($j=0; $j $cols) { $schema_insert = ""; for($j=0; $j