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

updating order of entries

Thread began 5/14/2014 6:26 am by Jamie | Last modified 5/15/2014 8:58 am by Jason Byrnes | 378 views | 11 replies |

Jamie

updating order of entries

Hi Jason

On a backend page results, I am using an update order function that Ray worked on with me a long time ago and I use on other sites.

I have an issue with one right now. In the database there are currently 37 entries in the 'speakers' table. If I change the entry found at position 1 to, for example, position 7 it gets pushed to 3rd from bottom and not sure how to stop this. It appears that, from the attached, it is down to the fact that the speakerorder column numbers get grouped by the first digit)

How do I get it to group by size of number rather than 'type'?

Thanks

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

see PM

Sign in to reply to this post

Jamie

see PM

Sign in to reply to this post

Jason ByrnesWebAssist

see PM

Sign in to reply to this post

Jamie

see PM

Sign in to reply to this post

Jason ByrnesWebAssist

the problem was caused by the SpeakerOrder values not having leading 0s, so the order was being forced:
1
11
12
13
etc..
2
21
22
etc...


I changed the order by to add the leading 0s:
ORDER BY LPAD(CONVERT(SpeakerOrder,CHAR(3)),3,'0') ASC

Sign in to reply to this post

Jamie

Thanks. Jason.. Am assuming the change is on the front end speaker.php page rather that the back end results page?

Sign in to reply to this post

Jason ByrnesWebAssist

i made the change to:
/admin_cms/speakers_results.php

you may need to update the front end page also.

Sign in to reply to this post

Jamie

Brilliant... Thanks Jason. Is there a better solution to achieve this as I do others in future or is this *the* solution?

Cheers

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

I think in this case, the SpeakerOrder column is set to use the varchar data type.

if the data type where set to int for the SpeakerOrder column, the order would not need the leading zeros

as a varchar column it treats the numbers as text,
so:
1
10
11
12
etc is the proper order for text.

if the data type is int, it can recognize that 2 is after 1 in numeric sequence.

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...