MySQL Forums
Forum List  »  PHP

Re: Dynamically Change Query Based on User Input via PHP
Posted by: Rick James
Date: August 16, 2011 11:08PM

> I'd have to write it out 64 times! (2 to the 6th power)
Unmaintainable.

Here's some examples of how to do it 6 times instead of 2**6:
http://forums.mysql.com/read.php?10,381333 (Not working in MYSQL5.1)
http://forums.mysql.com/read.php?52,363838 (Problem with search when add BETWEEN to query)
http://forums.mysql.com/read.php?52,264473 (mutiple field query)
http://forums.mysql.com/read.php?10,247890 (write trim into INSERT and SELECT Queries)
(I claim those examples are even simpler.)

You may have to escape the strings instead of using bind.

Options: ReplyQuote


Subject
Written By
Posted
Re: Dynamically Change Query Based on User Input via PHP
August 16, 2011 11:08PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.