mysql_query() [[url]http://www.mysql.com/doc]:[/url] 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 'into kiwanis_info ( 'identity', 'firstnam', 'lastnam', 'phonenum', 'emailaddr', ' at line 1
Above is waht I get when inserting into a file from a class. The code looks as follows:
function addstate($ent, $errmsg, $identity) {
var_dump($ent);
$ent['identity'] = 0;
echo $query = "INSERT INTO into kiwanis_info ( 'identity', 'firstnam', 'lastnam', 'phonenum', 'emailaddr', 'address1', 'city1', 'state1', 'zipcode1', 'infrequest', 'organ')
values ('".$ent['identity']."', '".$ent['firstnam']."', '".$ent['lastnam']."', '".$ent['phonenum']."', '".$ent['emailaddr']."',
'".$ent['address1']."', '".$ent['city1']."', '".$ent['state1']."', '".$ent['zipcode1']."',
'".$ent['infrequest']."', '".$ent['organ']."')";
$result1 = mysql_query($query);
if ($result1) {
$this->identity = mysql_insert_id();
$identity = $this->identity;
$this->errmsg = "Information record $identity was added "; }
else { $this->errmsg = "ERROR ... Information record not added"; }
return $this->errmsg;
return $this->identity;
}
Don Johnston, e-mail: <EMAIL SNIPPED>