How To Sort Columns with Hyperlinks
Posted 15 October 2006 - 08:02 PM
Posted 16 October 2006 - 12:13 AM
then you can use a combination of charindex and substr to first locate the position of the first ">" (I don't think that ">" is a valid URL character), and the take everything after that and sort on that. You wouldn't need to strip the "</a>", since it's pretty will immaterial (at the end and always the same).
so something like:
order by substr(make,charindex(">",make),len(make)) -- this is untested and from memory, and most assuredly syntactically wrong
Posted 16 October 2006 - 07:27 AM
I found a way to accomplish what I was trying to do. I added two new data table columns; the first contains the opening hyperlink's tag:
<a href="http://www.google.com">and the second contains the closing hyperlink's tag:
</a>I gave the columns a instance/variable name of "openLink" (for the opening of hyperlink's tag) and "closeLink" (for the closing of hyperlink's tag). Then in my HTML/PHP, I used an echo to display all three instance/variable names.
Example: echo "$openLink $make $closeLink"; // this creates the hyperlink
This may not be the correct way to do this; but it worked great for me. Now all the text in my data table's column sorts in ascending order and the hyperlink tag's text is now excluded from the sorting process.
Posted 16 October 2006 - 04:32 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users