www.webdeveloper.com
Results 1 to 1 of 1

Thread: Host (ugh) won't install CF. How can I get this to work without it?

Hybrid View

  1. #1
    Join Date
    May 2010
    Posts
    43

    Host (ugh) won't install CF. How can I get this to work without it?

    jQuery UI's sortable plugin to update a database table's sort order field on the fly using ajax basically, tutorial is here.

    http://www.petefreitag.com/item/736.cfm

    Seemed like the perfect tutorial for what I am doing.


    Basically I have a bunch of sortables using jquery, they are unordered lists containing list items all with an ID that's basically listitemthing_1 all the way to 85.

    This tutorial shows how to 'save' their order (even a button with "save" or on the fly..)so next time you visit the page, or when the page is reloaded all the list items are in their appropriate sortables.
    The sortables I'm dealing with (Very simple):

    Code:
    	$(function() {
    		$("#sortable1, #sortable2, #sortable3, #sortable4, #sortable5, #sortable6, #sortable7, #sortable8, #sortable9, #sortable10").sortable({
    			connectWith: '.connectedSortable'
    		}).disableSelection();
    	});
    Basically, the php side of things is what I needed to understand because I wanted the values kept track of (or something with a hidden field..)

    Code:
    <cfparam name="url.fruitOrder" type="string">
    <!--- fruitOrder = fruit_1,fruit_2, etc...--->
    <cfset order = 0>
    <cfloop list="#url.fruitOrder#" index="item">
    	<cfset fruit_id = Val(ListLast(item, "_"))>
    	<cfset order = order+1>
    	<cfquery>
    		UPDATE fruit
    		SET sort_order = <cfqueryparam value="#order#" cfsqltype="cf_sql_integer">
    		WHERE fruit_id = <cfqueryparam value="#fruit_id#" cfsqltype="cf_sql_integer">
    	</cfquery>
    	<cfoutput>#fruit_id#</cfoutput>
    </cfloop>
    Is the Coldfusion code for the tutorial but since our web host won't install it I'm in a pickle.
    (I just took over the site, the guy before me signed us up with Hostpapa)

    How can I do this with just php?
    Last edited by Sodascript; 06-22-2010 at 02:45 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles