All,

I am getting the error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 which seems to be a common error when using INSERT with a string of data. I checked various forums for a solution. Many solutions indicated the user hadn't set variables properly. As you can see, I echoed my variables to ensure they are set and calling correctly. Other forums recommended a user ensure quotes and ticks are set.

Here is the output I am getting:

Code:
TimsLaptop
TIMTACULAR
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Variables are set.

Here is the entire code:

PHP Code:
<?phpsession_start();error_reporting(E_ALL); ini_set'display_errors','1');
$ExpectedRig = ($_SESSION['ExpectedRig']);$compname = ($_SESSION['compname']);echo $ExpectedRig;echo "<br>";echo $compname;echo "<br>";$link_id mysql_connect("l****""****""****") or die("Could not connect."); if(!mysql_select_db("***",$link_id)) die("database was not selected.");


$file_handle fopen("resultupload/$compname.csv""r");

while ((
$line_of_data fgetcsv($file_handle1000",")) !== FALSE) { $line_import_query="INSERT into bridges(MAC,DeviceName,SignalNoiseDBM,Distance,TxRxMbps,CCQ,ConnectionTime,LastIP,ComputerName,ExpectedRig) values('$line_of_data[0]','$line_of_data[1]','$line_of_data[2]','$line_of_data[3]','$line_of_data[4]','$line_of_data[5]','$line_of_data[6]','$line_of_data[7]','$compname','$ExpectedRig'"mysql_query($line_import_query) or die(mysql_error()); }
$file = ("resultupload/$compname.csv");fclose($file_handle);unlink($file);
?>
Any thoughts as to where I'm going wrong?