.
The simple but so annoying apostrophe sql problem
This is a common database problem, I have been having the same problem for a while, but didn't think it was that simple to fix.

I will describe the problem as simple as possible. Thing with mysql database and any other databases is that they extract data using simple command words, therefore it needs some reserved symbols, and one of them is a very important one in the english language. The apostrophe and what I did for long time was just to avoid contracting words to avoid using the apostrophe. quite ridiculously when the problem is so simple solved.
As I use asp.net as my coding language you will see the code for it. But as much as I know of coding, it wont be that hard to make the same functionality for both asp, php and any other web programming language.
Here you will see how to get around the sql apostrophe problem with asp.net
Lets say we have a string we want to add to our database.
dim thetextstring as string = "this is the text we want to add to the database, with an apostrophe ' there it was"
Now the only thing we need to do is replace the apostrophe with two, yes thats right, take a look.
thetextstring = thetextstring..Replace("'", "''")
Yes it is that simple, just want to share it with you, I just thought it was a bit more difficult, but now that I know, I will never try to take the easy way before I have made a bit of research as now.
C?sar says: 2008-05-07
German Bobadilla says: 2008-02-01
noypi says: 2007-11-22

