hmnnnn...
well I'm running into a bit of mysql error and I was hoping someone might be able to point out the flaw as I'm just not seeing it:
<?php
$table_name = "filing_dates";
$dbname = "web";
$filename = ".htdbaccess";
$file = fopen($filename, "r");
$contents = fread($file, filesize($filename));
fclose($file);
$dbvars = explode("\n", $contents);
$dbuser = stripslashes($dbvars[0]);
$dbpass = stripslashes($dbvars[1]);
$host = "localhost";
$connection = @mysql_connect($host, $dbuser, $dbpass) or die(@mysql_error('connection'));
$db = @mysql_select_db($dbname, $connection) or die(@mysql_error('db'));
//$result = @mysql_query($sql, $connection) or die(@mysql_error());
//return $result;
$filename = "ANSWER.txt";
$file = fopen($filename, "r");
$contents = fread($file, filesize($filename));
fclose($file);
$lines = explode("\n", $contents);
for($i=0; $i<count($lines); $i++){
$variables = explode(";", $lines[$i]);
$mysql_date = date("Y-m-d", strtotime($variables[0]));
$sql = "INSERT INTO filing_date $mysql_date, $variables[1], $variables[2]";
mysql_query($sql, $connection) or die(mysql_error());
}
?>
now this is the error I'm getting in the browser when trying to run this file:
You have an error in your SQL syntax near '2002-07-29, AK, 01/01/02-07/26/02' at line 1
and I'm just not sure what the issue is.
thanks much!