2 Replies Latest reply on Jun 14, 2007 2:10 PM by Mark_O

    search function :: is it possible?

    bossche001
      Hi all

      I want to make a search function with flex/coldfusion to search items through my mySQL database.
      I've searched the web, but I noticed there are no topics related to that. Is it even possible??? :-)

      Hope someone can point me out to some tut to develop a common searchfuntion with coldfusion.

      Tom
        • 1. Re: search function :: is it possible?
          batmitra Level 1
          Hi
          yes it is possible, i don't work with coldfusion neither with mysql, i work with .net and microsoft SQL ,but if you are able to connect your coldfusio with mysql , then you can use webservices or httpservices to make search functions
          • 2. Re: search function :: is it possible?
            Mark_O
            We're doing it with Coldfusion / FLEX2 / MS-SQL
            but you should be able to apply the same principles with MYSQL

            Here is a rough sample of how it works:

            CFC
            <cffunction name="gResults" access="remote" returntype="query">
            <cfargument name = "category" default="" type="string">
            <cfstoredproc procedure="mystoredproc" datasource="mydatasource">
            <cfprocparam cfsqltype="cf_sql_varchar" value="#arguments.category#">
            <cfprocresult name="myresults">
            </cfstoredproc>
            <cfreturn myresults>
            </cffunction>

            You’ll need this stuff in your flex project somewhere:
            FLEX

            <mx:Script>
            <![CDATA[
            public function buttonclick():void
            {
            myService.gResults category.selecteditem.data;
            }
            public function gResults_Result(event:ResultEvent):void
            {
            var myDataSet:ArrayCollection=event.result as ArrayCollection;
            resultgrid.dataProvider=myDataSet;
            return
            }
            ]]>
            </mx:Script>

            <mx:RemoteObject id="myService" destination="ColdFusion" source="components.myCFC" showBusyCursor="true">

            <mx:method name="gResults" result="gResults_Result(event)" fault="Alert.show(event.fault.message)"/>

            </mx:RemoteObject>