Using the guidelines suggested by netnuts for the use of Data Objects for Database access, specifically in relation to unnamed placeholders
# the data we want to insert
$data = array('Cathy', '9 Dark and Twisty Road', 'Cardiff');
$STH = $DBH->("INSERT INTO folks (name, addr, city) values (?, ?, ?);
$STH->execute($data);
unfortunately seems to produce a parse error for the code
# the data we want to insert
$data = array($first_name, $second_name, $email_from, $telephone, $dateofbirth, $addresslone, $addressltwo, $townnm, $countynm, $typeapp, $issubscribed);
$STH = $DBH->("INSERT INTO members (fname, sname, email, phone, dob, addressl1, addressl2, town, county, type, subscribed) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$STH->execute($data);
Parse error: syntax error, unexpected ‘(‘, expecting T_STRING or T_VARIABLE or ‘{‘ or ‘$’ in /HTMLADDRESS.php on line 82
Line 82 is specifically that which begins with the assignment of the variable $DBH to $STH
I have also executed this code with all variables in the data array wrapped in quotes, with the same result.
what
is telling you is that after the
->it wasnt expecting a(, thats right because there should be a method call.it should be
its an error in netnuts code.