close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Wildcard in where

Thread began 3/17/2011 2:14 pm by tom.kurshinsky298027 | Last modified 3/17/2011 6:46 pm by Jason Byrnes | 1352 views | 9 replies |

tom.kurshinsky298027

Wildcard in where

I have a drop down box that I use as the selection for the where clause in a query, works fine. Now I want to add a wildcard character to get all records. If I use a % character I get a 406 not acceptable error message. I've tried using all manner of quotes around it but get the same. Any ideas?

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

just use an empty option:

<option value="">Show All</option>

in your select list.

Sign in to reply to this post

tom.kurshinsky298027

Returns no records.

Further info. The dropdown gets populated from a query. And I'm adding the All Records manually.

<form action="Tdrill_ResultsDynamic.php" method="get" enctype="multipart/form-data" name="TSelect" id="form1">
<div align="center">
<select name="TechSel" size="1" id="TechSel">
<option value="">Show All</option>
<?php
do {
?>
<option value="<?php echo $row_initial['techid']?>"><?php echo $row_initial['Technology']?></option>
<?php
} while ($row_initial = mysql_fetch_assoc($initial));
$rows = mysql_num_rows($initial);
if($rows > 0) {
mysql_data_seek($initial, 0);
$row_initial = mysql_fetch_assoc($initial);
}
?>
</select>
<input type="submit" name="TechButton" id="TechButton" value="Submit" />
</div>
</form>

Sign in to reply to this post

Jason ByrnesWebAssist

can you send your entire results page so i can see the whole code in context.

Sign in to reply to this post

tom.kurshinsky298027

Attached a text file.

Attached Files
results.txt
Sign in to reply to this post

Jason ByrnesWebAssist

in data assist search, you have the techid column set to filter on the S_techid text box.

$WADbSearch1->addComparisonFromEdit("techid","S_techid","AND","Includes",0);


instead of hard coding the where cluse to use your select list, why not just delete the S_techid text box, and rename the select list to S_techid?

data assist search will dynamicly create the where clause using form elements that pass a value.

meaning that if your select list default empty option is selected:
<option value="">Show All</option>

that cxolumn will not be included in the where clause.


the way you are doing it now would require hand coding the recordset with an if statement to only include that column in the where clause if a value is passed.

Sign in to reply to this post

tom.kurshinsky298027

Originally Said By: Jason Byrnes
  $WADbSearch1->addComparisonFromEdit("techid","S_techid","AND","Includes",0);.  



So in DataAssist Search, I delete that line? And on my start page I rename the dropdown to S_techid?

Sign in to reply to this post

Jason ByrnesWebAssist

no, leave that line in place.

in the recordset, delete the where clause you have added.

in your search form, delete the S_techid text field.


then rename the TechSel select list you created to S_techid

Sign in to reply to this post

tom.kurshinsky298027

Sorry. I'm feeling dense.

"in the recordset, delete the where clause you have added."
and the variable?

"in your search form, delete the S_techid text field."
Do you mean the seperate search page in this case drill_search.php? Because there is no S_Techid text field there because I deleted it while editing that page.

Sign in to reply to this post

Jason ByrnesWebAssist

yes, and the variable,

if you have already deleted that field, then dont worry about it, just name the select list S_techid.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...