473,765 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Brief description pulled from long description

basically i have a description in a mysql table. Is there any way to
pull say like the first 10-20 words for a brief description?

Thanks so much,
Mike

Feb 14 '06 #1
4 1303
if(strlen($late st) >= 20) { $latest = substr($latest[$i][2], 0, 20)."..."; }

Hope this helps
"Mikey P" <ph*********@co mcast.net> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
basically i have a description in a mysql table. Is there any way to
pull say like the first 10-20 words for a brief description?

Thanks so much,
Mike

Feb 14 '06 #2
d
"Mikey P" <ph*********@co mcast.net> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
basically i have a description in a mysql table. Is there any way to
pull say like the first 10-20 words for a brief description?
If you want an actual count of words, you can do this:

$brief=join(" ", array_slice(exp lode(" ", $description), 0, 10));

where $description is your long description, and 10 is how many words you
want. Bear in mind usually you'd work out how long your short description
should be on its letter-count, as that's more accurate (though still not
pixel-accurate, obviously).
Thanks so much,
Mike

Feb 14 '06 #3
Thanks so much this helped out a lot!

Feb 15 '06 #4
Mikey P wrote:
basically i have a description in a mysql table. Is there any way to
pull say like the first 10-20 words for a brief description?


Note quite words, but something like that perhaps:

mysql> select substring(your_ description_col ,1,80) from your_table;

which will give you the first 80ish charactrs.

/m
Feb 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
1532
by: Adam Barr | last post by:
For a book I am working on, I have written a brief (9 page) summary of Python. The intent of this is that an experienced programmer who did not know Python would be able to get enough information to read and understand Python programs. It is not meant to be a 100% complete summary of the language, but everything in there should be correct. If anyone is interested, please feel free to read it and send me comments. Note that the material...
2
1827
by: Larry Bates | last post by:
Anybody know what variable I need to define in my class to set the long description that shows up in the Services control panel applet? _svc_name_ holds the short name _svc_display_name_ holds the long name _svc_?????_ holds the description Thanks, Larry
4
2249
by: rbt | last post by:
How does one associate a "Description" with a Windows service written in Python? I've just started experimenting with Python services. Here's my code... copied straight from Mr. Hammond's "Python Programming on Win32": import win32serviceutil import win32service import win32event class test_py_service(win32serviceutil.ServiceFramework): _svc_name_ = "test_py_service"
9
2150
by: BCS | last post by:
I have a web site in which the site administrator can input information to a database through a web form. The information then gets displayed on ASP pages. One field is a large text field. Of course, without html tags, the text gets displayed on the web page as one long paragraph since the database doesn't store any line breaks or paragraph breaks. The obvious solution (to me) is to use html tags like <br> in the input. However, while...
5
2219
by: Paul H | last post by:
How do you folks get a reliable and complete brief of what is required before development starts? I am forever going back to a client once a project has started saying "Hang on, now that I've started building this I realise what you want is impossible, we'll have to do this way instead....etc.." OK, so this is partly down to me not getting all the facts from day one, but if the client does not give detailed, accurate instructions there...
22
1728
by: Adam Barr | last post by:
For a book I am working on, I have written a brief (7 page) summary of C. The intent of this is that an experienced programmer who did not know C would be able to get enough information to read and understand C programs. It is not meant to be a 100% complete summary of the language, but everything in there should be correct. If anyone is interested, please feel free to read it and send me comments. Note that the material is copyrighted,...
10
1314
by: Steve | last post by:
Is there a page on the web which simply lists the controls available in asp.net 2.0 with a brief description of each? I just want this as a reference, so that I am aware of all the controls available to me. I haven't managed to find anything, can somebody help?
4
1604
by: Joe Fallon | last post by:
If I have an Enumeration can I give a text description for each value? e.g. something like Public Enum Colors Black "Really cool Black" Blue "Ice Cold Labatts" End Enum
1
165
by: Anil Gupte/iCinema.com | last post by:
Once upon a time, long, long ago.... there was an editor called BRIEF (by Underware). Yes, they were an Aussie firm. Anyway, this was my favorite editor for the longest time in DOS (Am I dating myself or what?). One particularly neat feature was the ability to cut and paste columns. Someone said that Visual Studio has an emulation mode for this editor. Is this true? How can I get at it? Thanx, -- Anil Gupte
0
10156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7375
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5419
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.