MySQL Forums
Forum List  »  PHP

Re: How do you dynamically add additional variables to a PDO SQL query?
Posted by: Peter Brawley
Date: November 13, 2019 09:37AM

Sorry, I can't follow those code excerpts.

In general, you'd want a function that asks a user to pick a column and enter a value then adds the column and value to the Where clause " ... and `somecolumn` = 'somevalue'", or perhaps " ... and `somecolumn` LIKE '%somevalue%'".

When you're writing PHP code that generates SQL, stub out the generated SQL so you can inspect & test it.

Options: ReplyQuote




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.