Jump to content

Archived

This topic is now archived and is closed to further replies.

deejay

how to limit the number of digits returned in a field

Recommended Posts

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

Share this post


Link to post
Share on other sites

try this:

 

SELECT

 

table1.title,

table1.idnumber,

LEFT(table1.description,150)

 

FROM table1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.