Re: Limit characters in a long text

2006-03-22 Thread CodeHeads
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bill Adams wrote:
> http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
> I recommend "LEFT( )".
> 
> If you are looking to do it in PHP then this is the wrong email list.
> 
> Good luck.

Sorry about that I realized I picked the wrong mailing list after I sent
it.  Sorry again.

- --
Best regards,
~WILL~
Key: http://code-heads.com/keys/ch1.asc
Key: http://code-heads.com/keys/ch2.asc
Linux Commands: http://code-heads.com/commands
Linux Registered User: 406084 (http://counter.li.org/)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFEIfUIfw3TK8jhZrsRAgBJAKCu9eiZbHWAY2VSYfqrwuGuoT/9ewCgj5to
U26Z/uD9hPZs9ukwREkMq64=
=gi7p
-END PGP SIGNATURE-

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Limit characters in a long text

2006-03-22 Thread Bill Adams

http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
I recommend "LEFT( )".

If you are looking to do it in PHP then this is the wrong email list.

Good luck.

b.


CodeHeads wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello all,

Have a question:
I would like to limit the amount of data viewed. I searched but did not
find anything.
Here is my code:

$get_c = "select * from $table ORDER BY news_id DESC LIMIT 5";
$get_c_res = mysql_query($get_c) or die(mysql_error());

   while ($c = mysql_fetch_array($get_c_res)) {
$news_id = $c['news_id'];
   $news_posted = $c['news_posted'];
$news_subject = $c['news_subject'];
$NEWS_D = nl2br(stripslashes($c['news_desc']));
}

I would like to limit $NEWS_D to say 100 characters.

- --
Best regards,
~WILL~
Key: http://code-heads.com/keys/ch1.asc
Key: http://code-heads.com/keys/ch2.asc
Linux Commands: http://code-heads.com/commands
Linux Registered User: 406084 (http://counter.li.org/)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFEIaDzfw3TK8jhZrsRAuZsAJ9S6QCvo6Pyru45qh1dzzANyD/OUgCgpuTG
RqcZaNUSgSA4TvHRusMzn18=
=P+Is
-END PGP SIGNATURE-

 



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Limit characters in a long text

2006-03-22 Thread CodeHeads
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello all,

Have a question:
I would like to limit the amount of data viewed. I searched but did not
find anything.
Here is my code:

$get_c = "select * from $table ORDER BY news_id DESC LIMIT 5";
$get_c_res = mysql_query($get_c) or die(mysql_error());

while ($c = mysql_fetch_array($get_c_res)) {
$news_id = $c['news_id'];
$news_posted = $c['news_posted'];
$news_subject = $c['news_subject'];
$NEWS_D = nl2br(stripslashes($c['news_desc']));
}

I would like to limit $NEWS_D to say 100 characters.

- --
Best regards,
~WILL~
Key: http://code-heads.com/keys/ch1.asc
Key: http://code-heads.com/keys/ch2.asc
Linux Commands: http://code-heads.com/commands
Linux Registered User: 406084 (http://counter.li.org/)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFEIaDzfw3TK8jhZrsRAuZsAJ9S6QCvo6Pyru45qh1dzzANyD/OUgCgpuTG
RqcZaNUSgSA4TvHRusMzn18=
=P+Is
-END PGP SIGNATURE-

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]