Jump to content

Recommended Posts

I have a found set of items that i wish to narrow down even further.

 

The products being displayed are accessories for trucks. I want to give the user the option to select their vehicle year make and model so that the items that are for that specific car will show, and everything else will be filtered out.

 

here is a visual example http://www.discounttruckaccessories.com/cilist.php?SubCategory2=Tailgate

 

For some reason when i choose the model make and year the error page displays claiming there are no records found. When I know for sure that there are records that meet the criteria.

 

here is the code for the form.

 

 

 

<form action="cinlist.php" method="get" id="nvehicle" name="nvehicle">
  <input type="hidden" value="<?php echo $sublist_row->getField('SubCategory2'); ?>" name="SubCategory2">
	<div>
<select id="pda-brand" >
					<option value="select">Select Make...</option>
					<option value="Dodge">Dodge</option>
			</select>


			  <select id="pda-type" name="pda-type" onchange='start_search()'>
			    <option class="select" value="select">Select type</option>
                    <?php foreach($dodge_result->getRecords() as $dodge_row){ ?>
			    <option class="Dodge" value="<?php echo $dodge_row->getField('id'); ?>"><?php echo $dodge_row->getField('id'); ?></option>
                    <?php } ?>
			    </select>
			  
        </div>
</form>

 

 

 

and here is the recordset

 

 

$cinlist_find = $Rackspace->newFindCommand('DTA INVENTORY');
$cinlist_findCriterions = array('SubCategory2'=>$_GET['SubCategory2'],'VehicleId'=>$_GET['pda-type'],);
foreach($cinlist_findCriterions as $key=>$value) {
    $cinlist_find->AddFindCriterion($key,$value);
}

 

can anyone help?

Link to comment
https://forums.phpfreaks.com/topic/167675-searching-within-a-found-recordset/
Share on other sites

put in you where clause

 

AND year LIKE '{$year}' AND make LIKE  '{$make}' AND blah

 

if you use %%

 

AND year LIKE '%{$year}%' AND make LIKE  '%{$make}%' AND blah

 

then if year or make is '' noting then it wont effect the statment because everything is nothing yet nothing is everything ;)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.