Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Simplifying queries in DBI

by graff (Chancellor)
on Mar 15, 2014 at 16:56 UTC ( #1078468=note: print w/replies, xml ) Need Help??

in reply to Simplifying queries in DBI

Another variation on my previous reply that might be relevant: I have a web app with a search page for probing a set of related tables, where the user can fill in search terms - it's a bilingual dictionary system, so search conditions can include things like headword spelling, pronunciation, part-of-speech, translated meaning, etc, in arbitrary combinations.

When the search form is submitted, the app loops over the fields that have been filled in by the user, and assembles two parallel arrays: "@where_clauses" and "@where_values". The first array is used to build the SQL statement (table names and join conditions are added as needed), and the second array is passed to the execute call for that statement. This way, the ordering of fields and placeholder values is assured.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1078468]
[Corion]: A good morning to you too, marto!
[marto]: hey Corion, good weekend?
[prospect]: Thank you
[marto]: no problem prospect
[Corion]: I hope you all spent a good weekend!
[Discipulus]: good morning eumonks!

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2017-07-24 08:05 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (348 votes). Check out past polls.