I wanted to know what would be considered "best practice" in terms of defining an SQL query based on input from various textboxes on a web page.
Per say, lets say if you have 8 input textboxes on a website, would you be needing to use a bunch of if statements to evaluate what SQL query that you would end up using?
ie.
var sql
var a = document.getElementByID('tb1').value
var b = document.getElementByID('tb2').value
var c = document.getElementByID('tb3').value
var d = document.getElementByID('tb4').value
if (a.length > 0 && b.length > 0 && c.length > 0 && d.length > 0) {
sql = "SELECT * FROM table WHERE [firstname] = '"+a+"' AND [middlename] = '"+b+"' AND [lastname] = '"+c"' AND [organization] = '"+d+"'"
}
ps. Im also using client-side Microsoft Jet, so no server or any sorts.