in reply to INSERT Problem
Whoa! I just realized the prepare statement in the loop overwrites the $sth you use for fetching. Use another name for the handle, like $ins.
Incidentaly, you could move the prepare statement before the loop, if you did it like this:
and replace the execute with$sql="INSERT INTO email (f_name, l_name, code, ext, email) VALUES (?, ?, ?, ?, ?)"; $ins=$dbh->prepare($sql);
Not only is that more maintainable (IMHO), but it should also be faster, since it only has to parse the SQL statements once. In addition, it protects you from things like single quotes in your input.$sth->execute($FNAME, $LNAME, $STR, $CT5, $EMAIL) || die $sth->errstr;
|
|---|