Hello guys,
i have try this code but i got error in the sql command.
the error is "column doesn't match the value"
can somebody help me.
my text file is:
"1","abcd","defg"
"2","uuuu","yyyy"
"3","pppp","xxxx"
the code:
<?
include "./common_emp.inc";
$link_id = db_connect();
mysql_select_db("resume_db");
$file = file($text_file);
while (list($key,$val) = each($file))
{
$val = ereg_replace('\"', "",$val);
$data = explode(",",$val)
$query = sprintf("INSERT INTO employer VALUES ('%s','%s','%s')", $data[0],$data[1],$data[2]);
$result = mysql_query($query);
if(!$result) error_message(sql_error());
}
?>
please help me out.
lizza