I'll try to reply to these as I can, in the order they came out. Didn't have a chance yesterday. But yes, I'm very interested in a msql plugin. Been wanting to do one just so we would have it. But haven't had a chance. One day I'd like a simple plugin to move the "pages" back end to a database. It's set up for it architecturally, just need to hammer out the code. Having said that, I'm not an expert at MSQL
On Mon, Sep 21, 2009 at 12:36 PM, DrunkenMonk <[email protected]> wrote: > > I've created a simple wrapper function for mysql access, which is > working fine, but it's breakable in some irritating ways. > > Most importantly, consider a page with title "rawson's pet rabbit" > > <(mysql BOLTmysqluser 'INSERT INTO list (name) values ("{+:title}")')> What is the + there for? Is that a sign to use to extract the title data var within the function? That's one work around to the problem you mention. In which case you could escape the quote marks at that time. I might suggest a more parameterized breakdown. Something like: <(mysql insert field=title value="{:title}" db=tablename)> Then depending on the $args[1], in this case "insert" you check all the parameters and construct your query. I think you would have fewer problems. Of course this doesn't solve the problem of what if " is in the "{:title}". I don't see any way around that... There's no way BoltWire can tell which ' to escape and which not to. Though arguably, you could add a line right to the top of the BOLTargs function like this: $x = preg_replace('/([a-z])(\')([a-z])/', '$1'$3', $x); That should at least take care of simple contractions--without messing with normal parameterizations. Would that help you? Cheers, Dan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "BoltWire" 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/boltwire?hl=en -~----------~----~----~----~------~----~------~--~---
