I got the following error message when I tried to run my script...
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 '[0], Array[1], Array[2], Array[3], Array[4], Array[5], Array[6], Array[7], Array' at line 1
The sql line in my php file looks like this:
//Insert data into table
for ($z = 0; $z < count($tmatch); $z++) {
$insert = "insert into company_income_statement values ('ABC1234567',$tmatch[$z][0], $tmatch[$z][1], $tmatch[$z][2], $tmatch[$z][3], $tmatch[$z][4], $tmatch[$z][5], $tmatch[$z][6], $tmatch[$z][7], $tmatch[$z][8], $tmatch[$z][9], $tmatch[$z][10], $tmatch[$z][11], $tmatch[$z][12], $tmatch[$z][13], $tmatch[$z][14], $tmatch[$z][15], $tmatch[$z][16], $tmatch[$z][17], $tmatch[$z][18], $tmatch[$z][19], $tmatch[$z][20], $tmatch[$z][21], $tmatch[$z][22], $tmatch[$z][23], $tmatch[$z][24], $tmatch[$z][25], $tmatch[$z][26], $tmatch[$z][27], $tmatch[$z][28], $tmatch[$z][29], $tmatch[$z][30], $tmatch[$z][31], $tmatch[$z][32], $tmatch[$z][33], $tmatch[$z][34], $tmatch[$z][35], $tmatch[$z][36], $tmatch[$z][37], $tmatch[$z][38], $tmatch[$z][39], $tmatch[$z][40], $tmatch[$z][41], $tmatch[$z][42], $tmatch[$z][43], $tmatch[$z][44], $tmatch[$z][45], $tmatch[$z][46], $tmatch[$z][47], $tmatch[$z][48], $tmatch[$z][49], $tmatch[$z][50], $tmatch[$z][51], $tmatch[$z][52], $tmatch[$z][53], $tmatch[$z][54], $tmatch[$z][55], $tmatch[$z][56], $tmatch[$z][57], $tmatch[$z][58], $tmatch[$z][59], $tmatch[$z][60], $tmatch[$z][61], $tmatch[$z][62], $tmatch[$z][63], $tmatch[$z][64], $tmatch[$z][65], $tmatch[$z][66], $tmatch[$z][67], $tmatch[$z][68], $tmatch[$z][69], $tmatch[$z][70], $tmatch[$z][71], $tmatch[$z][72], $tmatch[$z][73], $tmatch[$z][74], $tmatch[$z][75], $tmatch[$z][76], $tmatch[$z][77], $tmatch[$z][78], $tmatch[$z][79])";
mysql_query($insert) or die(mysql_error());
}
I am just wondering if the error is due to type mismatch (the data inputted is not of the same type as the type of the cell in the table) or if it's due to the fact that mysql cannot take in values from an array? Thank you in advance for any help!