Aug 27, 2006 #1 elck Programmer Joined Apr 19, 2004 Messages 176 Location NL Is this at all possible in any way or form? Code: $query="SELECT title,id,date FROM `content` WHERE `user`='$user' ORDER BY SUBSTRING(title,(INSTR(title,';;')+2)) ASC ";
Is this at all possible in any way or form? Code: $query="SELECT title,id,date FROM `content` WHERE `user`='$user' ORDER BY SUBSTRING(title,(INSTR(title,';;')+2)) ASC ";
Aug 27, 2006 1 #2 r937 Technical User Joined Jun 30, 2002 Messages 8,847 Location CA yes r937.com | rudy.ca Upvote 0 Downvote
Aug 27, 2006 Thread starter #3 elck Programmer Joined Apr 19, 2004 Messages 176 Location NL Thanks, it works too. At first it didn't, hence my question, but the problems were spaces in front of the substring. Now the code is even worse: Code: $query="SELECT title,id,date FROM `content` WHERE `user`='$user' ORDER BY TRIM(SUBSTRING(title,(INSTR(title,';;')+2))) ASC "; Is this an efficient way, or should I grab all matches in a PHP array and perform the substr function there? Upvote 0 Downvote
Thanks, it works too. At first it didn't, hence my question, but the problems were spaces in front of the substring. Now the code is even worse: Code: $query="SELECT title,id,date FROM `content` WHERE `user`='$user' ORDER BY TRIM(SUBSTRING(title,(INSTR(title,';;')+2))) ASC "; Is this an efficient way, or should I grab all matches in a PHP array and perform the substr function there?
Aug 27, 2006 #4 r937 Technical User Joined Jun 30, 2002 Messages 8,847 Location CA if you perform the substring in php, you will also have to sort the entire result set yourself, right? let the database do it r937.com | rudy.ca Upvote 0 Downvote
if you perform the substring in php, you will also have to sort the entire result set yourself, right? let the database do it r937.com | rudy.ca
Aug 27, 2006 Thread starter #5 elck Programmer Joined Apr 19, 2004 Messages 176 Location NL Thanks Upvote 0 Downvote