[SOLVED] Insert Statement problems
Posted: Wed Jun 13, 2007 1:17 pm
I'm having trouble with this MYSQL statement
from my php code:
the returned error is
I wouldn't be surprised if it is a really easy mistatke that I am just not noticing in my statement. By the way, FY_2000_AG, FY_2000_IND, FY_2000_SRV, FY_2005_AG, FY_2005_IND, FY_2005_SRV are all VARCHAR columns in the MYSQL table country_html.
Code: Select all
INSERT INTO country_html (FY_2000_AG,FY_2000_IND,FY_2000_SRV,FY_2005_AG,FY_2005_IND,FY_2005_SRV) VALUES(".$row[1][117].",".$row[1][121].",".$row[1][125].",".$row[1][118].",".$row[1][122].",".$row[1][126].");Code: Select all
function mysql_insert_array($database){
$row = $this->get_regex_array();
$this->connect();
$this->database($database);
$this->null_test($this->get_regex_array());
$sql_query="INSERT INTO country_html (FY_2000_AG,FY_2000_IND,FY_2000_SRV,FY_2005_AG,FY_2005_IND,FY_2005_SRV) VALUES(".$row[1][117].",".$row[1][121].",".$row[1][125].",".$row[1][118].",".$row[1][122].",".$row[1][126].");";
$this->query($sql_query);
$this->close();
}INSERT INTO country_html (FY_2000_AG,FY_2000_IND,FY_2000_SRV,FY_2005_AG,FY_2005_IND,FY_2005_SRV) VALUES(.. ,.. ,.. ,24.5 ,39.4 ,12.4 ); failed. Error number: 1064 Message: 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 '. ,.. ,.. ,24.5 ,39.4 ,12.4 )' at line 1
I wouldn't be surprised if it is a really easy mistatke that I am just not noticing in my statement. By the way, FY_2000_AG, FY_2000_IND, FY_2000_SRV, FY_2005_AG, FY_2005_IND, FY_2005_SRV are all VARCHAR columns in the MYSQL table country_html.