Jump to content

solved---only print some of an entry


chico1st

Recommended Posts

To elaborate on Fenway's answer about printing 'some' of a field, his method is designed to abstract a defined length of data from a MySQL data field.  Example:

[code]$query = "SELECT left(your_column_name, 100) FROM your_table_name .... "; // retrieve ONLY 100 characters[/code]

Alternatively, you can abstract ALL of the database data and use the substr() function to print a portion of it.  The php manual provides lots of examples of substr() use.
heres what i have
$query = "SELECT news.newsID, news.pictureID, news.name AS newsName, news.abstract, [b]left('news.fulltext',100)[/b], date.name " .
  "FROM news, date WHERE news.dateID = date.dateID ORDER BY date.name";

i tried this too
$query = "SELECT news.newsID, news.pictureID, news.name AS newsName, news.abstract, [b]left(news.fulltext,100)[/b], date.name " .
  "FROM news, date WHERE news.dateID = date.dateID ORDER BY date.name";

and i looked at these commands and found nothing
http://www.mysqlfreaks.com/mysql_statements.php
is there another manual?
THANKS!
PS the substr() works i just tried it but i figure this will process faster

Archived

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

×
×
  • Create New...

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.