PHP Simplicity Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Guest posting is allowed. Again!

Author Topic: how to shorten text reuslt retrieved from mysql row ?  (Read 2496 times)

0 Members and 1 Guest are viewing this topic.

Shazly

  • Guest
how to shorten text reuslt retrieved from mysql row ?
« on: August 16, 2004, 07:29:35 PM »

 ???
Logged

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: how to shorten text reuslt retrieved from mysql row ?
« Reply #1 on: August 17, 2004, 05:02:54 AM »

you can either retrive the whole text and then use the php substr() or just use LEFT() like this:
Code: [Select]
SELECT LEFT(textfield, 100) AS shorttext FROM table_1;this will fetch the first 100 chars from the text field ..
Logged

We don't need a reason to help people
 

+ Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.
Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What is the answer to one plus one? (in numbers):