[PHP-DB] Cutting strings

2003-01-26 Thread Chezney
Hi

I have values in my table but for one of the fields I would only like to
display the first 5 chars instead of 15 how is this possiable?



--
Kind Regards,

Chezney




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Cutting strings

2003-01-26 Thread Peter Lovatt

Hi 

from the manual


http://www.mysql.com/doc/en/String_functions.html


LEFT(str,len)
Returns the leftmost len characters from the string str: 

mysql SELECT LEFT('foobarbar', 5);
- 'fooba'

HTH

Peter



-Original Message-
From: Chezney [mailto:[EMAIL PROTECTED]]
Sent: 26 January 2003 09:08
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Cutting strings


Hi

I have values in my table but for one of the fields I would only like to
display the first 5 chars instead of 15 how is this possiable?



--
Kind Regards,

Chezney




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Cutting strings

2003-01-26 Thread Michael Uyttersprot
Use the substr function

string substr ( string string, int start [, int length] )

http://be.php.net/manual/en/function.substr.php

Greetz,
Michael

-Original Message-
From: Chezney [mailto:[EMAIL PROTECTED]] 
Sent: dimanche 26 janvier 2003 10:08
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Cutting strings

Hi

I have values in my table but for one of the fields I would only like to
display the first 5 chars instead of 15 how is this possiable?



--
Kind Regards,

Chezney




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php