View Single Post
Old 05-31-2009, 04:47 PM   #3 (permalink)
Killswitch
The Contributor
 
Join Date: Feb 2007
Posts: 64
Thanks: 9
Killswitch is on a distinguished road
Default

Ok, thanks. Actually figured this out with the help of someone... Here was the solution...

Code:
$where = array();
				
				if( isset( $_POST['stock_number'] ) ) {
					$where[] = "`stock_number` LIKE '%$search%'";
				}
				if( isset( $_POST['manufacturer'] ) ) {
					$where[] = "`manufacturer` LIKE '%$search%'";
				}
				if( isset( $_POST['model'] ) ) {
					$where[] = "`model` LIKE '%$search%'";
				}
				if( isset( $_POST['price'] ) ) {
					$where[] = "`price` LIKE '%$search%'";
				}
				if( isset( $_POST['vin'] ) ) {
					$where[] = "`vin` LIKE '%$search%'";
				}
				if( isset( $_POST['year'] ) ) {
					$where[] = "`year` LIKE '%$search%'";
				}
				$where_size = count( $where );
				$q_where = null;
				
				for( $i = 0; $i < $where_size; $i++ ) {
					$q_where .= "$where[$i] OR ";
				}
				$q_where = substr( $q_where, 0, -4 ); // remove the last " OR ";
Killswitch is offline  
Reply With Quote