On 10/08/06, Russbucket <[EMAIL PROTECTED]> wrote:
DBD::mysql::st execute failed: 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 '' at line 1 at insertmember.cgi line 56.

Code:
#Insert data
$sth = $dbh->prepare ("INSERT INTO Moses_Lake_Lions (First_Name, Last_Name,
Spouse, email, Home_Phone, Business_Phone, Cell_phone, Occupation_Employer,
Status_Key) Values
('$First_Name', '$Last_Name', '$Spouse', '$email', '$Home_Phone', '$Business_Phone', 
'$Cell_phone', '$Occupation_Employer', '$Status_Key')");

$rv = $sth->execute ();

#Retrieve data enter for verification
$sth = $dbh->prepare (qq {SELECT First_Name, Last_Name, Spouse, email,
Home_Phone, Business_Phone, Cell_phone, Occupation_Employer, Status_Key FROM
Moses_Lake_Lions WHERE Last_Name = $Last_Name}) or dienice ("Cannot prepare
statement:", $dbh->errstr);

You need to quote the $Last_Name}) in the where clause.
Better to use $dbh->quote rather than do it directly. That also
applies to the Select.

hth

--
cheers,
victor

Victor Churchill, Bournemouth, U.K.

Reply via email to