Hello All:
I created a simple WHERE statement based on some examples in the forum as shown here:
but when you search on the site I get this returned:
I cannot seem to get this search to work even when there ARE the right variables in the WHERE statement.
thanks for any help on this,
Paul
I created a simple WHERE statement based on some examples in the forum as shown here:
<?php
if(JRequest::getVar('startdate')){
?>
WHERE date > <?php echo JRequest::getVar('startdate'); ?>
<?php
}
?>
Then a simple search box of <b>Search</b>: <input type="text" name="startdate">
but when you search on the site I get this returned:
Unknown column 'date' in 'where clause' SQL=SELECT count(*) FROM jos_chronoforms_contractor_resume_form WHERE date > 06/26/2009Unknown column 'date' in 'where clause' SQL=SELECT count(*) FROM jos_chronoforms_contractor_resume_form WHERE date > 06/26/2009
I cannot seem to get this search to work even when there ARE the right variables in the WHERE statement.
thanks for any help on this,
Paul
ok, so basically I found a post here in the forum after the fact....as usual. LOL...
I put this in the WHERE part of my form
and then just made a simple search box with the same name.
My only issue is I want it to say something if it finds nothing like, your search returned no results.
Any thoughts from anyone on this would be great
Paul
I put this in the WHERE part of my form
<?php
$search_array = array('application', 'state', 'emr_soft_vend');
$where = array();
foreach ( $search_array as $search ) {
$value = JRequest::getVar($search, '' , 'post');
if ( $value ) {
$where[] = " $search LIKE '%$value%' ";
}
}
if ( !empty($where) ) {
echo " WHERE ".implode(' AND ', $where);
}?>
and then just made a simple search box with the same name.
<div style="float:left">
Search for a <b>Application</b>: <input type="text" name="application">
<input type="submit" value="Search" name="undefined" style='width:80px; color:#cccccc; background-color:#222222; cursor:pointer;' /></div>
My only issue is I want it to say something if it finds nothing like, your search returned no results.
Any thoughts from anyone on this would be great
Paul
Whoot! Thanks Bob it worked.
I just had to play around with some formatting to make it look pretty instead of the message being right up against the submit button
Thanks again for the help.
Paul
I just had to play around with some formatting to make it look pretty instead of the message being right up against the submit button
Thanks again for the help.
Paul
This topic is locked and no more replies can be posted.