Simple ? - table not found
Posted: Sat May 29, 2004 7:50 pm
I have the following code...
<?php
...
$upfile = 'uploads/'.$userfile_name;
$id = $HTTP_GET_VARS["id"];
echo "id - $id";
$sql = 'LOAD DATA LOCAL INFILE ''$upfile'' INTO TABLE `fund_$id` FIELDS TERMINATED BY '','' ENCLOSED BY ''"'' ESCAPED BY ''\\\\'' LINES TERMINATED BY ''\\r\\n''( `first_n` , `last_n` , `class` , `product` )';
...
?>
Now the problem I have is when I run it I get the following error:
Table 'beper_fundraising.fund_$id' doesn't exist
I can't for the life of me figure out why it's not reading in the "$id" variable?? After all on the line above I echo'd it to make sure it was reading it, and yes it printed out the id as expected. I see the error as being something in the sql code, but can't figure it out, any help would be appreciated, thanks.
<?php
...
$upfile = 'uploads/'.$userfile_name;
$id = $HTTP_GET_VARS["id"];
echo "id - $id";
$sql = 'LOAD DATA LOCAL INFILE ''$upfile'' INTO TABLE `fund_$id` FIELDS TERMINATED BY '','' ENCLOSED BY ''"'' ESCAPED BY ''\\\\'' LINES TERMINATED BY ''\\r\\n''( `first_n` , `last_n` , `class` , `product` )';
...
?>
Now the problem I have is when I run it I get the following error:
Table 'beper_fundraising.fund_$id' doesn't exist
I can't for the life of me figure out why it's not reading in the "$id" variable?? After all on the line above I echo'd it to make sure it was reading it, and yes it printed out the id as expected. I see the error as being something in the sql code, but can't figure it out, any help would be appreciated, thanks.