Code Monkey home page Code Monkey logo

Comments (11)

Spuds avatar Spuds commented on May 23, 2024

What's the best way to fix it?

🚽

😃

from smf.

emanuele45 avatar emanuele45 commented on May 23, 2024

👼

from smf.

sicommnend avatar sicommnend commented on May 23, 2024

I am just waking up, sleep typing lol. Have you tried sqlite_escape_string()?

from smf.

emanuele45 avatar emanuele45 commented on May 23, 2024

I tried with $smcFunc['db_escape_string'] that is the equivalent of sqlite_escape_string but no luck... :(

from smf.

Oldiesmann avatar Oldiesmann commented on May 23, 2024

Is this still an issue? I don't have an sqlite install that I can test this with.

from smf.

emanuele45 avatar emanuele45 commented on May 23, 2024

I didn't do anything to fix it, so...yes I'm pretty sure it's still an issue.

from smf.

 avatar commented on May 23, 2024

Just to get my head around this before I look at it, is the issue the double brackets in the PRAGMA call when executing?

from smf.

emanuele45 avatar emanuele45 commented on May 23, 2024

Technically the issue is that when installing SQLite creates a wrong name for the index I think, then it requires a some trick to remove it.

The basic fix is probably the one I provided above (even though someone with more SQLite knowledge may give advices), the best fix would be to remove the "broken" indexes and replace them with proper names...or something like that.

from smf.

Oldiesmann avatar Oldiesmann commented on May 23, 2024

I don't think there's much we can do about the "autoindex" indexes, as they're automatically generated when the primary key isn't an integer (see http://readlist.com/lists/sqlite.org/sqlite-users/7/37230.html). I don't even know if we can actually remove those either.

from smf.

tinoest avatar tinoest commented on May 23, 2024

Unfortunately escape_string uses the underlying c function sqlite3_mprintf with the %q operator I believe.

http://www.sqlite.org/c3ref/mprintf.html is the documentation on the function , it doesn't escape the ( or ) characters so passing it to that function won't rectify the issue. Only way that I can think of is a preg_replace or a strtr .

Hope that is of some use...

from smf.

Oldiesmann avatar Oldiesmann commented on May 23, 2024

Closing per #1916

from smf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.