Inserting Variables
| From: | Wade Berlin | Date: | Tue, 09 Oct 2001 14:24:14 +0000 |
| Subject: | Inserting Variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-70486@lists.php.net to get a copy of this message | ||
Pardon me if your code was just shorthand but:
When I set $sqlstatement = INSERT INTO tdefa8 VALUES ("$q1", "$q2",
"2001-10-09")
THEN it inserts "$q1" and "$q2" into the database - rather than their
assigned values
When I set $sqlstatement = INSERT INTO tdefa8 VALUES ($q1, $q2,
"2001-10-09")
THEN it doesn't insert ANYTHING
FYI: I execute the statement like this:
$query = "$sqlstatement";
$result = MYSQL_QUERY($query);
I even tried: $query = $sqlstatement;
try:
$sqlstatement = "INSERT INTO tdefa8 VALUES ('$q1', '$q2',
'2001-10-09')";
or
$sqlstatement = "INSERT INTO tdefa8 VALUES (\"$q1\",\"$q2\",
\"2001-10-09\")";
both work for me.
Thanks,
Wade Berlin, Backstreet Production Group Inc.
----------------------------------------------
Backstreet Production Group......www.bpweb.com
904.398.8730................(fax) 904.396.0335
----------------------------------------------