Hi all,
We have a database which we want to expose to our users. That database is ment to be queried, but we want an interface upon that database so you can use certain attributes. We are examining if we can do that with php.
Is there some sort of framework out in the open (query builder or so) which can generate optimized SQL queries based upon user selections? So they can click their selecion criteria in a form or so.
Any advice is appreciated.
gr,
Paul
Form based queries
Moderator: General Moderators
If you want to build this yourself, a series of if/else/elseif statements would be the way to go. Gradually building your SQL query.
An example:
An example:
Code: Select all
$sqlQuery = 'SELECT * FROM `table` WHERE';
if($_POST['somecriteria'] == $sampleValue){
$sqlQuery .= " `somefield` = '$someValue";
} else {
$sqlQuery .= " `somefield` = '$someOtherValue";
}
echo $sqlQuery;Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Not exactly what I meant
Well, thanks for the help but...
I need a little more than that I'm affraid. The idea is that a frontend is able to get the criteria from the user. So they type in postal code froM: .... till .....
We have about 20 attributes to search on, and they can search for more than one criteria.
Those selections must be saved for later adjustments
I think this is done before, so I post my question here. I found something that has a basic idea of mhat I want, call qmaker from Jay Narain.
I need a little more than that I'm affraid. The idea is that a frontend is able to get the criteria from the user. So they type in postal code froM: .... till .....
We have about 20 attributes to search on, and they can search for more than one criteria.
Those selections must be saved for later adjustments
I think this is done before, so I post my question here. I found something that has a basic idea of mhat I want, call qmaker from Jay Narain.