Partial Record Display

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Yanayaya
Forum Commoner
Posts: 42
Joined: Tue Dec 02, 2008 7:49 am

Partial Record Display

Post by Yanayaya »

I am working on a small search engine that searches my mysql database.
It displays the details in rows. However it is showing the FULL job descriptions. To make my page more user friendley I would like to display on a few lines of the job description. Then the user could click on that particular result and view more details. So what I want to know is how can I show only a partial part of a mysql field??
mavieng
Forum Newbie
Posts: 10
Joined: Thu Jan 29, 2009 12:34 pm

Re: Partial Record Display

Post by mavieng »

SELECT LEFT(JobDescription, 100) FROM TABLENAME
// IT WILL PICK FIRST 100 CHARACTERS OF JOB DESCRIPTION FIELD


OR

SELECT LEFT(JobDescription, LENGTH(JobDescription)/2) FROM TABLENAME
// IT WILL PICK FIRST HALF CHARACTERS OF JOB DESCRIPTION FIELD
Yanayaya
Forum Commoner
Posts: 42
Joined: Tue Dec 02, 2008 7:49 am

Re: Partial Record Display

Post by Yanayaya »

mavieng wrote:SELECT LEFT(JobDescription, 100) FROM TABLENAME
// IT WILL PICK FIRST 100 CHARACTERS OF JOB DESCRIPTION FIELD


OR

SELECT LEFT(JobDescription, LENGTH(JobDescription)/2) FROM TABLENAME
// IT WILL PICK FIRST HALF CHARACTERS OF JOB DESCRIPTION FIELD

Top stuff, thank you for that :)
Post Reply