Jump to content

t_varible error


ady01

Recommended Posts

Im getting an error when running the below code, anybody got a clue why  ?

 

Error is  :

 

Parse error: syntax error, unexpected T_VARIABLE in /data/members/paid/a/d/ady01.co.uk/htdocs/smb1buddylist/close.php on line 11

 

My code is :

 

<?php
include 'config.php'

$query  = "SELECT * FROM Addresses";
$result = mysql_query($query) or die('Error, query failed');

$tsv  = array();

while($row = mysql_fetch_array($result, MYSQL_NUM))
{
   $tsv[]  = implode("\t", $row);
}

$tsv = implode("\r\n", $tsv);


$fileName = 'mysql-to-excel.xls';
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$fileName");

echo $tsv;


?>

Link to comment
https://forums.phpfreaks.com/topic/107115-t_varible-error/
Share on other sites

strange because i can use my config file to connect on other php parts of my site, this is my config file  :::

 

<?php 
$AddressBook_HOST="localhost";
$AddressBook_Username="*******";
$AddressBook_Password="*******";
$AddressBook_DatabaseName="*********";

if($AddressBook_Username=="[username]"){
die('Please Specify the Username');
}
if($AddressBook_Password=="[pw]"){
die('Please Specify the Password');
}
if($AddressBook_DatabaseName=="[database]"){
die('Please Specify the Database');
}

?>

Link to comment
https://forums.phpfreaks.com/topic/107115-t_varible-error/#findComment-549169
Share on other sites

Good point , how the hell i forgott that i dont know... now its working but not displaying in excel like its meant to ! its now showing the blow but needs to be downloaded to excel  ?

 

 

50 522380 Ptechnology group alivemore tgoater [email protected] example example Joanne A [email protected] None 51 358225 eservices person a Person 1 [email protected] example example Robert [email protected] Place order Via EDI link 54 test test test test test test test test test testing server

Link to comment
https://forums.phpfreaks.com/topic/107115-t_varible-error/#findComment-549182
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.