Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Problem using date variable in php script
May 4, 2005, 11:20 pm
rate this thread
I'm having trouble with the following line of code in my php script:
$result = mysql_query('LOAD DATA LOCAL INFILE "NYSE_".$today.".txt"
INTO TABLE main FIELDS TERMINATED BY "," LINES TERMINATED BY ","');
I've tested $today and it gives the correctly formatted date. And when
I hard code the file name, the mysql database is filled as
advertised...everything is fine. But I've tried every variation of
date variable I can think of and it fails. Well, actually no error,
but the above line of code doesn't seem to run because the table stays
'$today' is required because the file name changes each day and has the
current date in its name. (code -> $today=date("ymd"); <- )
Thanks for your help!
Re: Problem using date variable in php script
On Wed, 04 May 2005 18:20:05 -0700, jim.kelly wrote:
The text within the single quotes is not interpreted.
What you want is the following:
$result = mysql_query("LOAD DATA LOCAL INFILE NYSE_.$today.txt ".
'INTO TABLE main FIELDS TERMINATED BY "," LINES TERMINATED
Egoist: A person of low taste, more interested in themselves than in me.