[Gllug] mySQL and PHP

Jackson, Harry HJackson at colt-telecom.com
Tue Jul 10 11:49:14 UTC 2001


Hi all

	In the last two days I have managed to get Apache mySQL and PHP
working. They are in no means secure or set up properly yet but the I am
able to view the data on the internal network and my was that impressive.
Never done anything like that before in my snuff and am waiting to
demonstrate it to the people who will decide if we can use this tool or not.


	The following is some SQL for mySQL that will create a table in my
test database. The problem that I am getting is with the WorkLog column. Due
to its size I have had to use TEXT as the type. This means that when it is
displayed it appears as a long String with no formatting at all and this is
quite hard to read. As you can see from the title this is one of the fields
that people will want to have access to because it holds the most useable
data about the case in question.

Question:
	How do I format the text in the field.

Ideas:
	I am pretty sure you can use Perl to do this sort of thing but I am
not sure if it would need to be done before I load it into the database or
if it can be done after it goes in. I am also not sure how to use Perl in
both cases. My preferred option would be to use something internal to mySQL
to avoid having scripts all over the place. I also do not want to have to
format the field every time I call a page but when I load the data so using
PHP seems out of the question unless there are Guru's out there who know how
to do it.


use remedy_harry

truncate table remedy_base;

CREATE TABLE remedy_base 
(CASEID VARCHAR(20) ,
Arrived VARCHAR(20) , 
Type VARCHAR(20) , 
Name VARCHAR(30) ,
Short VARCHAR(150),
Details VARCHAR(255),
WorkLog TEXT,
Individual VARCHAR(20),
Status VARCHAR(30),
Pending VARCHAR(30));


LOAD DATA LOCAL INFILE "remedy.csv" INTO TABLE remedy_base 
		FIELDS TERMINATED BY ',' 
		ENCLOSED BY '"'
        	  	LINES TERMINATED BY '\n';


Any help or pointers would be appreciated.

Regards;
Harry Jackson.


     



**********************************************************************
COLT Telecommunications
Registered in England No. 2452736
Registered Office: Bishopsgate Court, 4 Norton Folgate, London E1 6DQ
Tel. 020 7390 3900

This message is subject to and does not create or vary any contractual
relationship between COLT Telecommunications, its subsidiaries or 
affiliates ("COLT") and you. Internet communications are not secure
and therefore COLT does not accept legal responsibility for the
contents of this message.  Any view or opinions expressed are those of
the author. The message is intended for the addressee only and its
contents and any attached files are strictly confidential. If you have
received it in error, please telephone the number above. Thank you.


**********************************************************************

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list