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? Link to comment https://forums.phpfreaks.com/topic/169980-solved-quick-php-sql-question/ 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"; Link to comment https://forums.phpfreaks.com/topic/169980-solved-quick-php-sql-question/#findComment-896694 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. Link to comment https://forums.phpfreaks.com/topic/169980-solved-quick-php-sql-question/#findComment-896695 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.