Coder Social home page Coder Social logo

Comments (3)

noncent avatar noncent commented on August 11, 2024

Hi tmuks,

the code

if(strstr(key($aWhere), ' ')){

has two methods, first it is strstr to check whether a space exists or not in keys which is getting by key as second method.

Lets have a example:

$q = $db->select ( 'customer', 'fname, lname', array (
        'lname =' => 'Mikey',
        'or fname =' => 'Scott'
), 'ORDER BY fname' )->results ();

As you see I am passing'lname =' => 'Mikey', with where clause array to execute multiple where clause. When user pass space where array key then it means they want to execute multiple where clause.

from pdo_class_wrapper.

tmuks avatar tmuks commented on August 11, 2024

Thanks for your reply

My question is how can you use string function on array?
Please check following query, is it works?
$q = $db->select ( 'customer', 'fname, lname', array (
'lname >=' => 'Mikey',
'or fname >=' => 'Scott'
), 'ORDER BY fname' )->results ();

from pdo_class_wrapper.

noncent avatar noncent commented on August 11, 2024

Yes, tmuks.. it will work. It will create query

NOTICE: Executed Query -> 
SELECT fname, lname FROM `customer` WHERE lname >= "mikey" OR fname >= "scott" ORDER BY fname;

look once what happening key getting the first array key as string and strstr finding space exist or not in array key (only first array key). So, I am using a strstr function with string..:)

from pdo_class_wrapper.

Related Issues (17)

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.