deejay Posted April 11, 2003 Share Posted April 11, 2003 Hi basically i am making a search which has a description in it, what I want to do is only return 150 letters of that description. i thought this would work from the manual but it doesn\'t <?php SELECT table1.title, table1.idnumber, table1.description(LEFT,150) FROM table1 ?> anyone know what I should be doing. Thanks Deej Quote Link to comment https://forums.phpfreaks.com/topic/335-how-to-limit-the-number-of-digits-returned-in-a-field/ Share on other sites More sharing options...
effigy Posted April 11, 2003 Share Posted April 11, 2003 try this: SELECT table1.title, table1.idnumber, LEFT(table1.description,150) FROM table1 Quote Link to comment https://forums.phpfreaks.com/topic/335-how-to-limit-the-number-of-digits-returned-in-a-field/#findComment-1083 Share on other sites More sharing options...
deejay Posted April 14, 2003 Author Share Posted April 14, 2003 hi Thanks for that, i found I had to add AS to get it to work. <?php LEFT(product_pages.main_desc,450) AS description_one, ?> and now works, cheers Quote Link to comment https://forums.phpfreaks.com/topic/335-how-to-limit-the-number-of-digits-returned-in-a-field/#findComment-1107 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.