Re: only showing partial info of a field in mysql...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Tristan,

Thursday, March 4, 2004, 10:27:34 AM, you wrote:

TPrsc> You know in PHPmyADMIN...
TPrsc> if you hav a large field, and hit browse, you only see some fo the text...
TPrsc> is this a PHP thing, or a MySQL thing... more improtantly, how can I do
TPrsc> that??

I don't know how PHPmyAdmin does it, but you can do this in SQL
directly without having to do it in PHP. Look at the SQL functions:

LEFT(), MID(), RIGHT() and SUBSTRING().

I.e.

SELECT LEFT(longfield, 100) FROM table

This will bring back the first 100 characters from the longfield
column (assuming it has 100 characters in it).

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux