Solved

PHP quote_smart not being written to database

Posted on 2007-11-25
2
1,006 Views
Last Modified: 2013-12-12
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

0
Comment
Question by:alanpollenz
2 Comments
 
LVL 20

Accepted Solution

by:
steelseth12 earned 500 total points
ID: 20347569
You are missing a comma (,) after pm_message value
$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

0
 

Author Closing Comment

by:alanpollenz
ID: 31410901
Thanks.  I noticed that after I posted this question and I was just finishing up testing.

Alan
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
paypal ipn url 5 53
UPDATE query not working in mysqli php 8 48
PHP Parse error: syntax error, unexpected '[' 1 22
Php recording post 4 35
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now