Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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]
[LanX]: how difficult is IP spoofing in the intranet?
[Your Mother]: I'm curious to hear the answer.
[LanX]: never mind
[LanX]: we have a vulnaribility task force in the company flooding our servers with fake attacks
[LanX]: I called them complaining about the load, and they told me to just ignore their IP
[LanX]: ... in the logs
[LanX]: but I tend to just reject it by an apache rule
[shmem]: LanX: start a DDOS upon their servers :-P
[LanX]: well I could hack a honeypot xD

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (15)
As of 2018-03-19 14:33 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.