Padgoi Posted August 12, 2009 Share Posted August 12, 2009 I have an SQL query: $q = "SELECT pid, topic_id, author_name, author_id from ibf_posts order by pid desc limit 1"; How can I limit the author name to say 10 characters? I have a code that displays the author name but I only want it to show 10 characters. Can I do this via the SELECT function? Quote Link to comment Share on other sites More sharing options...
Alex Posted August 12, 2009 Share Posted August 12, 2009 $q = "SELECT pid, topic_id, LEFT(author_name, 20), author_id from ibf_posts order by pid desc limit 1"; Quote Link to comment Share on other sites More sharing options...
Padgoi Posted August 12, 2009 Author Share Posted August 12, 2009 Thank you my good man! Much obliged, suh. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.