How do I escape Variables? - VisualCron - Forum

Community forum

Okay, I'm loving this application i'm testing it, but let's get straight to the point here.

My job error log said this:

Exception in Task: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's new policies are more crowdfunding friendly'
,'link here'
at line 3

So I have no idea how to escape that variable. Thank you for your help out front.
Forum information
If you get that kind of error you need to paste the whole SQL text here, otherwise it is hard for us to debug the cause. Also, if you use a Variable inside we need to know the exact value of the Variable as well.
Please like  VisualCron on facebook!
This was my query.

INSERT INTO test_entries (feed,guid,timestamp,title,link) VALUES ('{USERVAR(feed14)}'
,'{TRIGGER(Active|LastTrigger|RSS.Result.PubDate|yyyy-d-M h:mm:ss)}'

Uservar contains a the RSS feed URL that is currently being crawled.

The title held something along the lines of Paypal's new policies are more crowdfunding friendly As you can see, no escaping cut off the sentence and throw me an error, and ultimately failing the task.

Which leads me to ask the question I had already asked once. How do I escape variables?
So, the problem is the quote. And escaping that is the same way you would escape an quotein MySQL. I see two alternatives:

1. use double quote instead of single quote if you have a single quote inside the value; something like this; VALUES ("{USERVAR(feed14)}"
2. or, if that does not work, you need to find the escape character in MySQL and use the replace function in VisualCron to exchange that value
Please like  VisualCron on facebook!
Scroll to Top