LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-31-2004, 01:57 AM   #1
infected
Member
 
Registered: Jun 2003
Location: Iowa
Distribution: undecided
Posts: 30

Rep: Reputation: 15
php mysql question


im creating a very simply blog program and got stumped. My mysql table has a text field which contains the text of the blog, what i want to do is on the front page just show a certain length of the blog entry say only 200 characters. What is the best way to implement this? should i get the entire text from the table and use php functions to display a certain length or does there exist an sql statement that does it for me?
 
Old 10-31-2004, 01:04 AM   #2
infected
Member
 
Registered: Jun 2003
Location: Iowa
Distribution: undecided
Posts: 30

Original Poster
Rep: Reputation: 15
of i found Left(variable name, length) that would do it, any other suggestions?
 
Old 10-31-2004, 09:50 PM   #3
m_shroom
Member
 
Registered: Oct 2004
Location: Queen Charlotte B. C. Canada
Distribution: openSUSE 11.1
Posts: 42

Rep: Reputation: 15
Re: php mysql question

Quote:
Originally posted by infected
im creating a very simply blog program and got stumped. My mysql table has a text field which contains the text of the blog, what i want to do is on the front page just show a certain length of the blog entry say only 200 characters. What is the best way to implement this? should i get the entire text from the table and use php functions to display
It is very easy with php
Code:
$disply=substr($artical, 0, 200);
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP/MySQL table question newuser455 Programming 10 11-03-2005 04:50 AM
PHP/MySQL Question Corey Edwards Linux - Software 4 01-14-2005 12:18 PM
mysql.so and php install question Jake_B Linux - Software 0 10-19-2004 08:01 PM
PHP MySQL Query Question vi0lat0r Programming 1 07-15-2004 05:02 AM
mySQL, PHP, Apache Question stardotstar Linux - Newbie 6 09-08-2003 04:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration