Link to home
Start Free TrialLog in
Avatar of alanpollenz
alanpollenz

asked on

PHP quote_smart not being written to database

I have a script to place some data into a table, and the script uses quote_smart.  Sometimes the data gets written to the table, however, I just came across a situation where it did not get written, and was wondering if anyone could offer some suggestions.

--------------------------------------------------------------------------------------

First, here is the code snippet:

    $query = sprintf('INSERT INTO team_email_pending (pm_sender, pm_sender_email, pm_sender_title, pm_subject, pm_message, '.$sql1.'pm_member_type, pm_recipients, pm_copy_coaches, pm_cid, pm_datetime, pm_unixtime, pm_ip, pm_host, pm_agent)'." VALUES(%s, %s, %s, %s, %s ".$sql2."%s, %s, '$copy_coaches', '$cid', '$timestamp', '$unixtime', '$ip', '$visitor_host', '$agent')",
            quote_smart($this_full_name),
            quote_smart($this_email_address),
            quote_smart($sender_title),
            quote_smart($email_subject),
            quote_smart($email_text),
            quote_smart($member_type),
            quote_smart($recipients));
      $result_query = @mysql_query($query);

--------------------------------------------------------------------------------------

The only difference between this and submissions that are successfully written are the subject and text.  In this particular case, the subject is:

Gift Cards! A note from Cindy McLain

and the text is:

New WAVE Families,

There will be 2 more gift card orders placed in 2007.  December 1st and December 15th are the next deadlines.  The latest gift card order form is located on the team web site.  Simply email me at fctm@bellsouth.net to place your order.

SPECIAL for the December 1st order ONLY!  Lowe’s Home Improvement is offering an additional discount, so that you can receive 5% off of these cards.  They are available in $25, $100, and $500 increments.  Normally the discount is less than 5% and the team is unable to grant the fund raising credit.  THIS IS A ONE TIME OFFER.

ALSO NEW TO THE ORDER FORM THIS MONTH IS MARRIOTT in $500 amount.  This is a great way for business travelers to earn fund raising for your account.

Remember STOCKING STUFFERS!!!!!!!!

Email me your orders by December 1st, and as always send me any questions.

Thanks,

Cindy McLain
fctm@bellsouth.net

--------------------------------------------------------------------------------------

Here is the result of the query:

INSERT INTO team_email_pending (pm_sender, pm_sender_email, pm_sender_title, pm_subject, pm_message, pm_member_type, pm_recipients, pm_copy_coaches, pm_cid, pm_datetime, pm_unixtime, pm_ip, pm_host, pm_agent) VALUES('Alan Pollenz', 'alan@webgrafxx.com', '', 'Gift Cards! A note from Cindy McLain', 'New Wave Families,
\r\n
\r\nThere will be 2 more gift card orders placed in 2007. December 1st and December 15th are the next deadlines. The latest gift card order form is located on the team website. Simply email me at fctm@bellsouth.net to place your order.
\r\n
\r\nSPECIAL for the December 1st order ONLY! Lowe\'s Home Improvement is offering an additional discount, so that you can receive 5% off of these cards. They are available in $25, $100, and $500 increments. Normally the discount is less than 5% and the team is unable to grant the fund raising credit. THIS IS A ONE TIME OFFER.
\r\n
\r\nALSO NEW TO THE ORDER FORM THIS MONTH IS MARRIOTT in $500 amount. This is a great way for business travelers to earn fund raising for your accpunt.
\r\n
\r\nRemember STOCKING STUFFERS!!!!!!!
\r\n
\r\nEmail me your orders by December 1st, and as always send me any questions.
\r\n
\r\nThanks,
\r\n
\r\nCindy McLain
\r\nfctm@bellsouth.net' 'Team', 'ALL', '', 'a8ba47bf9c3e28fe100ef0d2e006ed6b', '2007-11-25 18:35:24', '1196033724', '65.192.152.126', 'cpe-065-192-152-126.nc.res.rr.com', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9')

--------------------------------------------------------------------------------------

Any idea why this particular message is not being written?

Thanks.

Alan


$query = sprintf('INSERT INTO team_email_pending (pm_sender, pm_sender_email, pm_sender_title, pm_subject, pm_message, '.$sql1.'pm_member_type, pm_recipients, pm_copy_coaches, pm_cid, pm_datetime, pm_unixtime, pm_ip, pm_host, pm_agent)'." VALUES(%s, %s, %s, %s, %s ".$sql2."%s, %s, '$copy_coaches', '$cid', '$timestamp', '$unixtime', '$ip', '$visitor_host', '$agent')",
		quote_smart($this_full_name),
		quote_smart($this_email_address),
		quote_smart($sender_title),
		quote_smart($email_subject),
		quote_smart($email_text),
		quote_smart($member_type),
		quote_smart($recipients));
	$result_query = @mysql_query($query);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of steelseth12
steelseth12
Flag of Cyprus image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alanpollenz
alanpollenz

ASKER

Thanks.  I noticed that after I posted this question and I was just finishing up testing.

Alan