GithubHelp home page GithubHelp logo

Comments (3)

adamwulf avatar adamwulf commented on July 26, 2024

I need to update the README, but you can use the find() method on the table objects. The find() method takes two arguments. the first is the list of fields to match along with their respective values. the second is optional operator to use for each field. For example, to search an imaginary users table:

$userstable = $db->table("users");
$userstable->find(array("last_update" => date("Y-m-d", time()-24*60*60),
                        "username" => "someuser"),
                        array("last_update" => "<="));

If an operator isn't provided, then it'll default to LIKE for text columns and = for everything else. The provided values can be an array, and in that case it'll use field IN (values array here) for the search

from json-to-mysql.

theitd avatar theitd commented on July 26, 2024

Thanks very much for the explanation. It makes much better sense.
I realised I was entering duplicates because I hadn't specified a unique ID for the JSON being inserted. The find & update worked automatically if the ID column was included.

I'm using the project to reduce times on a query which, up until now, used common_schema2.2 to extract the JSON. The difference is staggering (~75s down to ~18s). So thanks again!

from json-to-mysql.

adamwulf avatar adamwulf commented on July 26, 2024

awesome glad to hear it!

from json-to-mysql.

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.