Whew. I've tried a bazillion variations but must be missing something obvious. Can someone please take a look at this and see what I'm doing wrong?
If I create the query with raw data instead of variables, it works:
_________
$Query="INSERT into $TableName values (
'0',
Now(),
'0',
'Tom',
'Tom@mail.com',
'Art',
'azw@mail.com',
'no title tomorrow',
'no message today',
'cedarCreekSavannah',
'cedar creek creep'
)";
_________
When I try to use variables, the query prints out to the screen okay, but the mail() function returns false and the record isn't in the table.
_________
$Query="INSERT into $TableName values (
'0',
Now(),
'0',
' " . $_SESSION['rName'] . " ',
' " . $_SESSION['rEmail'] . " ',
' " . $_SESSION['sName'] . " ',
' " . $_SESSION['sEmail'] . " ',
' " . $_SESSION['msgTitle'] . " ',
' " . $_SESSION['msg'] . " ',
' " . $imgSrc . " ',
' " . $imgTitle . " '
)";
_________
I wondered if it was impossible to use SESSION variables, so I made new variables. That did the same thing.
_________
// create non-session variables for insert
$rN=$_SESSION['rName'];
$rE=$_SESSION['rEmail'];
$sN=$_SESSION['sName'];
$sE=$_SESSION['sEmail'];
$mT=$_SESSION['msgTitle'];
$ms=$_SESSION['msg'];
$Query="INSERT into $TableName values (
'0',
Now(),
'0',
' ".$rN." ',
' ".$rE." ',
' ".$sN." ',
' ".$sE." ',
' ".$mT." ',
' ".$ms." ',
' ".$imgSrc." ',
' ".$imgTitle." '
)";
_________
Here's the rest of the code I'm using for the insert
_________
// for testing only
print ("query: <br>$Query<p />\n");
// add data to db
if (mysql_db_query($DBName, $Query, $Link)){ // if successful, send notification to recipient
_________
When I print the query to the screen it reads:
_________
INSERT into artCard values ( '0', Now(), '0', ''azw', 'azw@mail.com', 'art', 'azw@mail.com', 'test6', 'test6', 'filename.jpg', 'Winter Flood Plain III' )
Any hints? I'm having way too much fun with this all by myself....
Thanks!

