RE: [PHP] ADODB Insert Question (Syntax)
| From: | Uber Wannabe | Date: | Tue, 07 Aug 2007 21:06:23 +0000 |
| Subject: | RE: [PHP] ADODB Insert Question (Syntax) | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260328@lists.php.net to get a copy of this message | ||
-----Original Message-----
From: Graham Anderson [mailto:grahama1970@gmail.com]
Sent: Tuesday, August 07, 2007 3:34 PM
To: php-general
Subject: [PHP] ADODB Insert Question (Syntax)
Hi
What is the proper way to get the ADODB class to automatically add
quotes to the below sql ?
I'm guessing that the below fails because none of the variables get
quoted with the method, qstr.
$sql = "insert into email (to_name, to_email, from_name, from_email,
subject, message, timestamp, ip) ";
$sql .= "values ($to_name, $to_email, $from_name, $from_email,
$subject, $message, $time, $ip)";
I tried something like the below to no avail
$sql .= "values($conn->qstr($to_name), $conn->qstr
($to_email), .......)";
Is there an accepted way to place multiple $variables inside an ADODB
insert statement?
many thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-----End Original Message-----
Okay, I'm probably missing something, but why can't the values portion just
say:
"values ('$to_name', '$to_email', '$from_name',... etc.
... with the single quotes around the variable names?
-- N/A