I have a mysql database with various large entries, what i wish to do is display the length of the the file contained within the database. For example, if i had a row that had Article ID: 1 Article Title: Interesting Title Article Body: This is a very long article
how would i work out how long the length in characters of the article body?
thanks foobar2k
You could either do this using internal functions of mysql or extracting and looking at the size of the files with php.
What datatype are these articles in the database?
just plain text
you can do something along the lines of
SELECT id_column, LENGTH(article_column) FROM your_table ORDER by date_column, time_column;
that will pull out all the lengths of the articles.
once you have the length of each of the documents, you can do something along the lines of
if ($lengthofthisdocument < 1000) echo "short document"; else echo "Long document";