PDA

View Full Version : Search Keywordsin database (via cfc)


odeathoflife
04-05-2003, 05:19 AM
hey folks,

I am trying to get my store to be able to search the keywords column in my database (access)
I have this for my cf function=


<cffunction name="keywordsearch" access="remote" returntype="query" output="false">
<cfargument name="keyword" type="text">
<cfquery name="SearchQuery" datasource="cart">
SELECT ProductDescription FROM products WHERE keywords LIKE '%#keyword#%'
ORDER BY ProductDescription
</cfquery>
<cfreturn SearchQuery>
</cffunction>

Thsi I believe is all well and good,
but I am having problems with the flash side of it.

I have categories that are selectable in the flash movie using variations of this code= buttons have a on release getData (1) / (2) etc...

function getData() {
basic.Products(dataView.getSelectedItem().data);
}
function Products_Result(result) {
_root.infoMC.ProductDescription.text = result.getItemAt(0).ProductDescription;
_root.infoMC.SKUNumber.text = result.getItemAt(0).SKUNumber;
_root.infoMC.UnitPrice.text = result.getItemAt(0).UnitPrice;
_root.infoMC.manufactLink.htmlText = result.getItemAt(0).manufactLink;
_root.infoMC.Information.text = result.getItemAt(0).Information;
_root.infoMC.imageMC.text = result.getItemAt(0).image;
}



But I am unsure how to say look at the searchfield text box, then grab relivant information from the keywords column, and return it to the dataView list box.


Any help would be appretiated in this, but there is no rush.

Thanks