[PHP] truncating dilema

2002-06-13 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi everyone, 

I'm making an idiot proof news database for a client and do not want to
include a 'description' field. I had thought to return a truncated
version of the actual stories as a description.

It has just occured to me though that if I'm to list maybe 100 news
items with descriptions it means alot of memory right because i have 100
items containing:
date
title
text (could be any length)

I will use substr() in my php to format the descriptions but I thought
I'd ask here if anyone had a *better* suggestion?

Many thanks
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9CQyyHpvrrTa6L5oRAtJdAKClDX77zJsH5LUSkaRG0KP6DEpJ2wCeK9BC
/WpypUV5ygtcBN/hwogsBeg=
=s+ae
-END PGP SIGNATURE-

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




Re: [PHP] truncating dilema

2002-06-13 Thread Julie Meloni


NW It has just occured to me though that if I'm to list maybe 100 news
NW items with descriptions it means alot of memory right because i have 100
NW items containing:
NW date
NW title
NW text (could be any length)

NW I will use substr() in my php to format the descriptions but I thought
NW I'd ask here if anyone had a *better* suggestion?


You could use the substring() function in MySQL (or a similar function
in your db of choice) to make the db do the work instead of PHP.

- Julie

-- Julie Meloni
-- [EMAIL PROTECTED]
-- www.thickbook.com

Find Sams Teach Yourself MySQL in 24 Hours at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




RE: [PHP] truncating dilema

2002-06-13 Thread Lazor, Ed

Why not just put a Subject field?  Most people use that to put a brief
description of the article.  Make the form field small and they'll keep
their input small.  Plus, you can set the maxlength value of the input field
to limit things.
http://www.htmlreference.com/htmlref95.html

 -Original Message-
 From: Nick Wilson [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 2:21 PM
 To: php-general
 Subject: [PHP] truncating dilema
 
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hi everyone, 
 
 I'm making an idiot proof news database for a client and do 
 not want to
 include a 'description' field. I had thought to return a truncated
 version of the actual stories as a description.
 
 It has just occured to me though that if I'm to list maybe 100 news
 items with descriptions it means alot of memory right because 
 i have 100
 items containing:
 date
 title
 text (could be any length)
 
 I will use substr() in my php to format the descriptions but I thought
 I'd ask here if anyone had a *better* suggestion?
 
 Many thanks
 - -- 
 Nick Wilson //  www.explodingnet.com
 
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)
 
 iD8DBQE9CQyyHpvrrTa6L5oRAtJdAKClDX77zJsH5LUSkaRG0KP6DEpJ2wCeK9BC
 /WpypUV5ygtcBN/hwogsBeg=
 =s+ae
 -END PGP SIGNATURE-
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




Re: [PHP] truncating dilema

2002-06-13 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Julie Meloni declared
 You could use the substring() function in MySQL (or a similar function
 in your db of choice) to make the db do the work instead of PHP.

Nice, I'll look it up. Cheers Julie.
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9CREkHpvrrTa6L5oRAvGxAKCttJgHoPi5CUPt2uBQOQFUxwsbKwCggO6j
gzmvxVqnCrPDU1Uzd4NWUXU=
=3HFs
-END PGP SIGNATURE-

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




RE: [PHP] truncating dilema

2002-06-13 Thread David Freeman


  It has just occured to me though that if I'm to list maybe 
  100 news items with descriptions it means alot of memory 
  right because i have 100 items containing:
  date
  title
  text (could be any length)
  
  I will use substr() in my php to format the descriptions but 
  I thought I'd ask here if anyone had a *better* suggestion?

Use mysql's substring as part of your query - consult your friendly
local mysql manual for more details.

CYA, Dave


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