PHP Html content stored into Mysql being truncated [solved]

I was storing HTML email to MySql DB

but for some weird reason all the email stored successfully but on retrieval only half was being displayed

after a lot of struggling, finally i figured out that data type in mysql table for that field was TEXT which stores only 65000 chars

I counted email content and it was 92056 chars

changed the data type to LONGTEXT and everything works like a charm

PHP conversion of MS Word Doc files to PDF or JPG

originally from http://superuser.com/questions/156189/how-to-convert-word-doc-to-pdf-in-linux


Alternative 1)

sudo apt-get install cups-pdf 

Then navigate to System > Administration > Printing and create a new printer, set it as a PDF file printer, and name it as “pdf”.

Then run:

oowriter -pt pdf your_word_file.doc 

Now you’ll find your .pdf file in ~/PDF.


Alternative 2)

sudo apt-get install wv tetex-extra ghostscript wvPDF test.doc test.pdf 

 

also check

http://wvware.sourceforge.net/

 

and

http://www.abisource.com/

import large mysql dump into xampp on windows using command line

its simpler and easier than you think

place your dump at some location

and type the command as below at command prompt

C:\xampp\mysql\bin>mysql -u root tenzing < c:\files\2011.06.02.tenzing.sql
C:\xampp\mysql\bin>mysql -u <username> -p <password> <database name> < <fullpath to file><file name>
Handy when bigdump will fail with some error or phpmyadmin will timeout
try command line
its super fast

Antiword on Linux Ubuntu

Antiword is a free MS Word reader. It converts the binary files from MS Word 6, 7, 97 and 2000 to text, Postscript and PDF. (dpkg package description)
To install this package in Ubuntu
$ sudo apt-get install antiword

You can use dpkg to know more about antiword after installing it

$ dpkg -s antiword

source:http://joysofprogramming.com/install-antiword-ubuntu/

On CentOS

http://www.indianwebportal.com/install-xpdflibxp-antiword-linux

How to install xpdf,libXp and antiword on Linux

How to install xpdf , libXp and antiword on Linux (Centos or Redhat 32 Bit ) server

cd /usr/local/src/

Dowload following RPM’s files under the /usr/local/src/ directrory.

wget http://mit.edu/zacheiss/dev/rhlinux/redhat-7.1-updates/SRPMS/xpdf-0.92-4.71.0.src.rpm

wget ftp://ftp.univie.ac.at/systems/linux/fedora/core/6/i386/os/Fedora/RPMS/libXp-1.0.0-8.i386.rpm

wget http://dag.wieers.com/rpm/packages/antiword/antiword-0.37-3.el5.rf.i386.rpm

or

http://dag.wieers.com/rpm/packages/antiword/?N=A

Then

rpm -ivh xpdf-0.92-4.71.0.src.rpm

rpm -ivh libXp-1.0.0-8.i386.rpm

rpm -ivh antiword-0.37-3.el5.rf.i386.rpm

Then you can check it

root@server [/usr/local/src]# which xpdf
/usr/local/bin/xpdf
root@server [/usr/local/src]# which antiword
/usr/bin/antiword

Done

PHP- Adding And Subtracting Dates

original article http://www.brightcherry.co.uk/scribbles/2009/01/06/php-adding-and-subtracting-dates/
Here’s how you add and subtract dates from one another. For example, this simple code can calculate what the date will be 2 weeks before or after 1998-08-14 (yyyy-mm-dd).
Subtracting days from a date
The following example will subtract 3 days from 1998-08-14. The result will be 1998-08-11.