MySQL Colon and Slashes causing Syntax error

Associate
Joined
28 Oct 2011
Posts
539
As the title states, I'm having trouble inserting strings containing colons and slashes into a TEXT field. I'm doing this using VB.NET .

I'm basically trying to insert a file path into a TEXT field, ie "C:\test\test1.exe"

Googled a bit and cant seem to find an answer.

Hopefully one of you people can help :). Cheers in advance
 
Associate
Joined
18 Sep 2003
Posts
903
The escape character in MySQL is the backslash, so your example after being escaped would become C:\\test\\test1.exe

But I would have thought however that VB.NET would have a function for doing MySQL escaping, or better still, a way to use placeholders with prepared statements. Hopefully someone that does .NET will come along and tell you what it is.
 
Associate
OP
Joined
28 Oct 2011
Posts
539
Ah after an hour of debugging... I found my mistake... kind of ashamed to admit.. but I missed a parenthesis.. that was all xD.

Pulling my hair out for an hour and that's all it was lol. Anyway thanks for the input redrum :)
 
Back
Top Bottom