[Gambas-user] MySQL Data

Eric Damron edamron at ...776...
Mon Jan 24 01:22:55 CET 2005


nigel at ...38... wrote:

>Eric,
>
>Could you list your code - I have no problems with entering the characters listed in the datamanager or in the simple program that I use for testing the database component.
>
>Nigel
>
>  
>
>>Message date : Jan 22 2005, 05:36 AM
>>From : "Eric Damron" <edamron at ...776...>
>>To : "Gambas Mail List" <gambas-user at lists.sourceforge.net>
>>Copy to : 
>>Subject : [Gambas-user] MySQL Data
>>
>>I'm writing a simple DVD collection database front end to MySQL in order 
>>to learn Gambas. I've noticed that when the user enters a title like 
>>"Hogan's Heros" an exception is thrown because of the apostrophe. I 
>>fixed this problem by sending all user inputs to a function that looks 
>>for this and returns ?\'? when it finds one.
>>
>>However, if the user enters a ?&? the same thing happens even if I 
>>convert it to ?\&? Does anyone know how to properly ?sanitize? user 
>>input to MySQL?
>>
>>Thanks.
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
>>Tool for open source databases. Create drag-&-drop reports. Save time
>>by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
>>Download a FREE copy at http://www.intelliview.com/go/osdn_nl
>>_______________________________________________
>>Gambas-user mailing list
>>Gambas-user at lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>>    
>>
>
>  
>
I've included a simple example project.  To use it:
Create a directory and copy it to the directory.  untar it:  tar xfv 
test.tar

Create a MySQL database called 'test'
Create a single table called DATA
DATA has two files:

id         -    primary key, Integer, Auto Increment
description    -    VARCHAR(255)

Run the program and enter some data like "John's"
Then try "Jane & Tarzan"

I can use the escape character "\" to allow data like "John's" but it 
doesn't work with "&"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.tar
Type: application/x-tar
Size: 10240 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20050123/05b3a076/attachment.tar>


More information about the User mailing list