Link to home
Start Free TrialLog in
Avatar of envizion
envizion

asked on

RemotingFlash Sites

Where i can find the scripts of addind,deleting and update scripts of flash remoting with coldfusion. I search but i find only model scripts. But I want Add and Delete like scripts. Tell me hte website addresses or books to find these things.
thanks
Avatar of Vicker Leung
Vicker Leung
Flag of Hong Kong image

Avatar of negatyve
negatyve

you mean "addind,deleting and update" a database?
Avatar of envizion

ASKER

to negatyve

Yes Adding Deletin updatind and retriving also i want answers.
search for the Time Entry application at Macromedia site...
http://www.macromedia.com/devnet/mx/flash/articles/time_entry.html
these are examples of coldfusion code to add, update, insert and delete. do you need the flash code too?

      <cffunction access="remote" output="false" returntype="any" name="GetUser">
            <cfargument name="userid" required="true" type="numeric" />
            <cftry>
                  <cfquery datasource="#application.dsn#" name="GetUserQuery">
                        SELECT * FROM Users WHERE userid = #arguments.userid#
                  </cfquery>
                  <cfcatch>
                        <cfreturn "error">
                  </cfcatch>
            </cftry>
            <cfreturn GetUserQuery>
      </cffunction>

      <cffunction access="remote" output="false" returntype="string" name="AddUser">
            <cfargument name="username" required="true" type="string" />
            <cfargument name="password" required="true" type="string" />
            <cftry>
                  <cfquery datasource="#application.dsn#">
                        INSERT INTO Users (username, password)
                        VALUES ('#arguments.username#', '#arguments.password#')
                  </cfquery>
                  <cfcatch>
                        <cfreturn "error">
                  </cfcatch>
            </cftry>
            <cfreturn "done">
      </cffunction>

      <cffunction access="remote" output="false" returntype="string" name="UpdateUser">
            <cfargument name="userid" required="true" type="numeric" />
            <cfargument name="usname" required="true" type="string" />
            <cftry>
                  <cfquery datasource="#application.dsn#">
                        UPDATE Users
                        SET username = '#arguments.usname#'
                        WHERE userid = #arguments.userid#
                  </cfquery>
                  <cfcatch>
                        <cfreturn "error">
                  </cfcatch>
            </cftry>
            <cfreturn "done">
      </cffunction>

      <cffunction access="remote" output="false" returntype="string" name="DeleteUser">
            <cfargument name="userid" required="true" type="numeric" />
            <cftry>
                  <cfquery datasource="#application.dsn#">
                        DELETE FROM Users WHERE userid = #arguments.userid#
                  </cfquery>
                  <cfcatch>
                        <cfreturn "error">
                  </cfcatch>
            </cftry>
            <cfreturn "done">
      </cffunction>
To Negatyve

Thanks for the code of cold fusion but I need Flash mx 2004 code also for this thing and search also i need. Already I finished update and delete but i need how can i retrive all infomation of particular user or student or any other person. in flash also i need this solutions.

thanks
ASKER CERTIFIED SOLUTION
Avatar of negatyve
negatyve

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial