Hi,

I'm not sure if this is the case, but I think this is a issue on python it
self and not on web.py.


I'm saying that because I have some set of scripts (No Web.py related) that
hang when fetching data from a Database (MySQL) that contains the '
character. (And some others too like "("or ")").

Unfortunately i'm totally out of time to debug my scripts (And till now is
making more sense to just open navicat and remove this occurrences when they
happens).


Which kind of DB Connector WebPy is using? (Or it lets you to choose? I
Never used DB with my webpy apps till now)...


Cheers

--
Leon Waldman
SysAdmin Linux - Arquiteto de Infra-Estrutura & TI.


On Fri, Nov 13, 2009 at 11:18 AM, Simon <[email protected]> wrote:

>
> Hi,
>
> I'm having a hard time figuring out the correct way of doing the
> following:
>
> In my database (SQLite), I have a "title" column, which is just a text
> field. One entry have a ' in it, example: It's pretty annoying
>
>
> When I try to do the following, it fails, due to the ' in title
> param= dict(title=title)
> results = db.select('shows', param, where="title= $title")
>
> I thought the solution was in Web.db.SQLParam or sqlquote, but they
> convert 'it's annoying' to '"It's annoying"', which also fails,
> because the database entry doesn't have the " in it. Or at least
> that's what I think is happening.
>
> The one solution I did find was:
>
> title = title.replace('\\', '\\\\')
> param= dict(title=title)
> results = db.select('shows', param, where="title= $title"
>
> That not as pretty as I would like and I'm a bit concerned that it's
> not always going to work or even be safe.
>
> Are there any better solutions using the webpy db functionality?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to