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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.