Steps to importing table data.

Steps to importing table data.

am 21.11.2004 03:07:28 von johnf

Hi,

I still haven't solved my "1044 Access Denied" error...

http://www.aspects.org.au/sqdb4.jpg

even though Randy suggested that some edition of phpMyAdmin might=20
have a 'Privileges' tab that could be the answer.

As can be seen at ;

http://www.aspects.org.au/sun1.jpg

There is no 'Privileges' tab. :-(

I thought however that someone here might be able to at least tell me
whether I am taking the correct steps to importing data into a
database and creating a table from it. Here are the steps I take....

(A) I go to phpMyAdmin 2.6.0

(B) Then double Click on my database jf_invcomma

(C) Then click on SQL tab.

(D) Where it says "Location of the textfile" I browse to my .sql
tables file on my PC.

(E) I then press "go"=20

Does anyone know whether these are the correct steps please ?=20
Or perhaps know a solution to the original problem ?

I am attempting this on a web server's Unix host.

Regards, John.


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org

Re: Steps to importing table data.

am 21.11.2004 05:26:44 von Daniel da Veiga

PhpMyAdmin is good, of course, but you see, it really hides a lot of
details that you'll step on while you're a developer, it would be good
if you learn the commands (console, SQL) instead of using this kind of
wizard. Even if your machine isn't the server, you can install the
client and connect to the database via console. The command "grant all
privileges on *.* to 'jf'" might work... To import data, the command
"load data infile" is a good way.

Best regards,

On Sun, 21 Nov 2004 13:07:28 +1100, John Fitzsimons
wrote:
>
> Hi,
>
> I still haven't solved my "1044 Access Denied" error...
>
> http://www.aspects.org.au/sqdb4.jpg
>
> even though Randy suggested that some edition of phpMyAdmin might
> have a 'Privileges' tab that could be the answer.
>
> As can be seen at ;
>
> http://www.aspects.org.au/sun1.jpg
>
> There is no 'Privileges' tab. :-(
>
> I thought however that someone here might be able to at least tell me
> whether I am taking the correct steps to importing data into a
> database and creating a table from it. Here are the steps I take....
>
> (A) I go to phpMyAdmin 2.6.0
>
> (B) Then double Click on my database jf_invcomma
>
> (C) Then click on SQL tab.
>
> (D) Where it says "Location of the textfile" I browse to my .sql
> tables file on my PC.
>
> (E) I then press "go"
>
> Does anyone know whether these are the correct steps please ?
> Or perhaps know a solution to the original problem ?
>
> I am attempting this on a web server's Unix host.
>
> Regards, John.
>
> --
> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> To unsubscribe: http://lists.mysql.com/win32?unsub=danieldaveiga@gmail.com
>
>


--
Daniel da Veiga
Computer Operator - RS - Brazil

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Re: Steps to importing table data.

am 21.11.2004 06:42:11 von johnf

On Sun, 21 Nov 2004 02:26:44 -0200, Daniel da Veiga wrote:
=20
>PhpMyAdmin is good, of course, but you see, it really hides a lot of
>details that you'll step on while you're a developer, it would be good
>if you learn the commands (console, SQL) instead of using this kind of
>wizard.=20

Well, I don't mind learning some commands but it seems like there are
many dozens/hundreds of commands, and variations of commands. A=20
major undertaking to learn/apply correctly.

If I were 30 years younger your idea might have more appeal, but I am
not. Added to that I ceased doing much command line stuff over ten
years ago.

>Even if your machine isn't the server, you can install the
>client=20

No idea what "client" you are talking about. Or how to setup/use=20
it. :-( My system is a win '98 one. My hosting co has, IIRC,
Unix/Apache/MySQL.

>and connect to the database via console.=20

I am guessing you are meaning some sort of telnet connection from my
windows box ? In any case I haven't used telnet for many years either
and wouldn't know which directories to connect to or execute commands
in.

>The command "grant all
>privileges on *.* to 'jf'" might work...=20

Ah ! That looks good. If I can work out where/how to apply that
command I will try it.

>To import data, the command
>"load data infile" is a good way.

The "infile" is my .sql or c.s.v. file ? If so I am not sure what the
relative syntax for transfer from my C:\ drive to the server's C:\
drive is. I guess I would get the IP address' of both and use=20
them somehow ?=20

Somewhat more complex than copy C:\something to D:\ It is=20
a pity everything Unix is so tedious/complex. :-(

>Best regards,

< snip >

Thanks Daniel. It sure is nice to see some competent people here
willing to help those of us who are newbies in regard to SQL/Unix.

Regards, John.


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org

RE: Steps to importing table data.

am 21.11.2004 12:32:40 von Patrick Questembert

WARNING: newbie here, trying to be on the contributing end for a change :-)

Firstly, I think all of your questions can be answered, without exception,
by one look at the MySQL online manual. Remember the power of Google too, if
you do a search on "load data infile MySQL" the first match you get is what
you need: http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html

To your questions:

The format of the source file can be CSV - if that's the case, be sure to
include the "FIELDS SEPARATED BY ','" directive for the load data statement.
It is NOT .SQL - if it is .SQL, these would be statements you want to
execute, which has nothing to do with loading data from a text file.

Regarding location of the file, you have two choices with LOAD DATA:
LOAD DATA LOCAL INFILE - will load data from a file located on the client,
in which case the pathname of the file corresponds to the client
LOAD DATA - will load data from a file located on the server, in which case
the pathname of the file corresponds to the server

Note that the server may be configured to disallow loading from files on the
client.

Lastly, you are NOT transferring "from the client's C: drive to the server's
C: drive", you are loading from either the client or the server's drive onto
a TABLE in the MySQL database, so only one drive is involved here.

Hope this helps.

Patrick

-----Original Message-----
From: John Fitzsimons [mailto:johnf@net2000.com.au]
Sent: Sunday, November 21, 2004 12:42 AM
To: win32@lists.mysql.com
Subject: Re: Steps to importing table data.


On Sun, 21 Nov 2004 02:26:44 -0200, Daniel da Veiga wrote:

>PhpMyAdmin is good, of course, but you see, it really hides a lot of
>details that you'll step on while you're a developer, it would be good
>if you learn the commands (console, SQL) instead of using this kind of
>wizard.

Well, I don't mind learning some commands but it seems like there are
many dozens/hundreds of commands, and variations of commands. A
major undertaking to learn/apply correctly.

If I were 30 years younger your idea might have more appeal, but I am
not. Added to that I ceased doing much command line stuff over ten
years ago.

>Even if your machine isn't the server, you can install the
>client

No idea what "client" you are talking about. Or how to setup/use
it. :-( My system is a win '98 one. My hosting co has, IIRC,
Unix/Apache/MySQL.

>and connect to the database via console.

I am guessing you are meaning some sort of telnet connection from my
windows box ? In any case I haven't used telnet for many years either
and wouldn't know which directories to connect to or execute commands
in.

>The command "grant all
>privileges on *.* to 'jf'" might work...

Ah ! That looks good. If I can work out where/how to apply that
command I will try it.

>To import data, the command
>"load data infile" is a good way.

The "infile" is my .sql or c.s.v. file ? If so I am not sure what the
relative syntax for transfer from my C:\ drive to the server's C:\
drive is. I guess I would get the IP address' of both and use
them somehow ?

Somewhat more complex than copy C:\something to D:\ It is
a pity everything Unix is so tedious/complex. :-(

>Best regards,

< snip >

Thanks Daniel. It sure is nice to see some competent people here
willing to help those of us who are newbies in regard to SQL/Unix.

Regards, John.


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=patrickq@nyc.rr.com


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Re: Steps to importing table data.

am 21.11.2004 14:11:35 von johnf

On Sun, 21 Nov 2004 06:32:40 -0500, Patrick Questembert wrote:

Hi Patrick,
=20
>WARNING: newbie here, trying to be on the contributing end for a change =
:-)

Glad to know I am not the only newbie here. :-)

>Firstly, I think all of your questions can be answered, without =
exception,
>by one look at the MySQL online manual.=20

Then you think incorrectly. Reading a manual and understanding it are
two totally different things.=20

>Remember the power of Google too,=20

Yes, I have. The power of Google IIRC gave me more than 9,000 "hits"
with my "1044 Access Denied" error.. Page after page of windows users
trying to work out why they got that error. The majority not getting
much more of an answer than RTFM. If a windows program had that many
people unable to even get to step number one then the programmer would
probably be laughed out of town. Or leave in disgrace of his own
volition.

Creating a database and creating/populating it is the most basic of
database tasks but MySQL makes one jump through hoops to do something
that is essentially trivial. In windows such things can be done with a
half dozen clicks of a mouse and maybe five minutes work.

>if
>you do a search on "load data infile MySQL" the first match you get is =
what
>you need: http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html

Thanks for pointing out the exact part of the manual. It doesn't
however explain in any way how/where I am supposed to put that syntax.

Added to that it mentions such things as "The mysqlimport client"
without giving a download link and/or instructions as to where it is
installed to/run from.

>To your questions:

>The format of the source file can be CSV=20

Yes, I was pretty sure I had read that in one of the many pages I had
read. I couldn't however see how a C.S.V. file could supply data and
info such as "key" column data etc.

>- if that's the case, be sure to
>include the "FIELDS SEPARATED BY ','" directive for the load data =
statement.

Command syntax. You know, I was thinking that this mailing list was
for windows users. Yet almost every answer talks about Unix commands.=20
This is like joining a Toyota mailing list where every post is about
=46ords.

>It is NOT .SQL - if it is .SQL, these would be statements you want to
>execute, which has nothing to do with loading data from a text file.

Well, thats what I first thought. Yet my hosting server had a video
tutorial where an .sql file appeared to be imported into a MySQL
database to create/populate it. From both a data and structure point
of view.

>Regarding location of the file, you have two choices with LOAD DATA:
>LOAD DATA LOCAL INFILE - will load data from a file located on the =
client,
>in which case the pathname of the file corresponds to the client

What's "the client" ? The hosting server ? A program ? If so then is
there a specific directory to load from ? The "mysql> LOAD DATA INFILE
'data.txt" suggests I need to find the mysql directory of the root on
my host's server.

>LOAD DATA - will load data from a file located on the server, in which =
case
>the pathname of the file corresponds to the server

C:\ ?

>Note that the server may be configured to disallow loading from files on=
the
>client.

Just what I needed. Another hoop to jump through. Thanks for pointing
that out.

>Lastly, you are NOT transferring "from the client's C: drive to the =
server's
>C: drive", you are loading from either the client=20

Well, the client would presumably be on my C: drive.

>or the server's drive onto
>a TABLE in the MySQL database, so only one drive is involved here.

Okay. Thanks.

Regards, John.


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org

Re: Steps to importing table data.

am 22.11.2004 15:50:38 von Daniel da Veiga

Greetings,

John Fitzsimons wrote:

>On Sun, 21 Nov 2004 06:32:40 -0500, Patrick Questembert wrote:
>
>
>>Remember the power of Google too,
>>
>>
>
>Yes, I have. The power of Google IIRC gave me more than 9,000 "hits"
>with my "1044 Access Denied" error.. Page after page of windows users
>trying to work out why they got that error. The majority not getting
>much more of an answer than RTFM. If a windows program had that many
>people unable to even get to step number one then the programmer would
>probably be laughed out of town. Or leave in disgrace of his own
>volition.
>
>Creating a database and creating/populating it is the most basic of
>database tasks but MySQL makes one jump through hoops to do something
>that is essentially trivial. In windows such things can be done with a
>half dozen clicks of a mouse and maybe five minutes work.
>
>
>
Sincerely, MySQL is the best open source database ever, it has
everything a newbie would need to create/populate a database, if you
know the basic about databases and SQL its possible to create a table
azap, if you don't, even Access would be difficult to deal with. If you
want your database to be stable and reliable, than you'll have to type
and understand the commands, else you'll get even more errors, mouse
clicks do what a programmer told the program to do, not always the best
choice.

>>if
>>you do a search on "load data infile MySQL" the first match you get is what
>>you need: http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html
>>
>>
>
>Thanks for pointing out the exact part of the manual. It doesn't
>however explain in any way how/where I am supposed to put that syntax.
>
>Added to that it mentions such things as "The mysqlimport client"
>without giving a download link and/or instructions as to where it is
>installed to/run from.
>
>
>
All MySQL executables are in your /bin directory, where they can be
reached by command prompt, they'll give you their syntax, and the manual
will tell you exactly what each command will do. The mysqlimport client
is the "mysqlimport" binary, that was designed to load data into MySQL
from a number of different sources.

>>To your questions:
>>
>>
>
>
>
>>The format of the source file can be CSV
>>
>>
>
>Yes, I was pretty sure I had read that in one of the many pages I had
>read. I couldn't however see how a C.S.V. file could supply data and
>info such as "key" column data etc.
>
>
>
You define the table on MySQL, the structure of the table (keys,
definitions, data types) are separated from the data, so, first you'll
define the table, then you can import the data, accourding to the table
definition, it will give you warnings or errors if the data does not
match the definition.

>>- if that's the case, be sure to
>>include the "FIELDS SEPARATED BY ','" directive for the load data statement.
>>
>>
>
>Command syntax. You know, I was thinking that this mailing list was
>for windows users. Yet almost every answer talks about Unix commands.
>This is like joining a Toyota mailing list where every post is about
>Fords.
>
>
>
Windows versions 3.x and 9x runs using a DOS core, that is a command
line OS, and users of the winXP have the MySQL Query Browser and the
MySQL Administrator, that are GUIs for what you need, and even using XP,
the command line is faster and easy to use.

>>It is NOT .SQL - if it is .SQL, these would be statements you want to
>>execute, which has nothing to do with loading data from a text file.
>>
>>
>
>Well, thats what I first thought. Yet my hosting server had a video
>tutorial where an .sql file appeared to be imported into a MySQL
>database to create/populate it. From both a data and structure point
>of view.
>
>
>
If you already have a table, you can export its definition and data in
form of a .sql file, that when imported, will create and populate the
table, you can even "build" an .sql file with a "CREATE TABLE" statement
and various "INSERT INTO", one for each row of the table.

>>Regarding location of the file, you have two choices with LOAD DATA:
>>LOAD DATA LOCAL INFILE - will load data from a file located on the client,
>>in which case the pathname of the file corresponds to the client
>>
>>
>
>What's "the client" ? The hosting server ? A program ? If so then is
>there a specific directory to load from ? The "mysql> LOAD DATA INFILE
>'data.txt" suggests I need to find the mysql directory of the root on
>my host's server.
>
>
>
I am sorry, but I can give you another answer with command line. Inside
the /bin directory there is the "mysql" program, commonly know as the
client, or mysql console. You can use the -h option to specify
the host you'll connect to, and the -u to log in. Once inside the
console, you can give the host any mysql commands, including "LOAD DATA
INFILE".

>>LOAD DATA - will load data from a file located on the server, in which case
>>the pathname of the file corresponds to the server
>>
>>
>
>C:\ ?
>
>
>
>>Note that the server may be configured to disallow loading from files on the
>>client.
>>
>>
>
>Just what I needed. Another hoop to jump through. Thanks for pointing
>that out.
>
>
>
If you're running the server on you machine, its ok to give paths to
files on your system, using the --local option.

>>Lastly, you are NOT transferring "from the client's C: drive to the server's
>>C: drive", you are loading from either the client
>>
>>
>
>Well, the client would presumably be on my C: drive.
>
>
>
>>or the server's drive onto
>>a TABLE in the MySQL database, so only one drive is involved here.
>>
>>
>
>Okay. Thanks.
>
>Regards, John.
>
>
>
>
Ok, now, lets go to the point. Have you defined your table structure? If
not, you'll have to do it, using a GUI program or the mysql console. I
suggest MySQL Query Browser, but you can take a look at an old post
regarding "best GUI client" at this mailing list. Once you do it (you'll
have to connect to your host, that will be asked by the GUI client you
choose) you can create the table, after creating your table, you can
load data in it by using the mysqlimport program like this:

C:\mysql\bin\mysqlimport.exe --user="root" -C -d
--fields-terminated-by="^" test "P:\PSAN01"

where test is your database, PSAN01 is the file to import, wich has
fields separated by ^s, but you can specify fields-terminated-by,
fields-enclosed-by, lines-terminated-by, etc. Now, you'll be angry with
me again, but you can refer to the manual pages for all the syntax.

Sorry if I can't give you the exacts commands or all the steps to do
what you want, I tried my best, if you need more help, please tell me
the table structure you need and the type and definition of the file to
load data from.

"If you build a program that stupid people can use, only stupid people
will use it" - Jhon Letterman

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Re: Steps to importing table data.

am 05.12.2004 00:55:45 von johnf

On Mon, 22 Nov 2004 11:50:38 -0300, Daniel da Veiga wrote:
=20
>John Fitzsimons wrote:

>>On Sun, 21 Nov 2004 06:32:40 -0500, Patrick Questembert wrote:
=20
Hi Daniel,

< snip >

>Sincerely, MySQL is the best open source database ever, it has=20
>everything a newbie would need to create/populate a database, if you=20
>know the basic about databases and SQL its possible to create a table=20
>azap, if you don't, even Access would be difficult to deal with. If you=20
>want your database to be stable and reliable, than you'll have to type=20
>and understand the commands, else you'll get even more errors, mouse=20
>clicks do what a programmer told the program to do, not always the best=20
>choice.

Well, I HAVE spent time learning a computer language before and it=20
was NOT one of my fun experiences. Interesting, yes. Something I=20
would want to repeat, no. At my age it gets increasingly difficult to
remember dozens/hundreds of different command syntax's.=20

Going through hundreds of pages of instructions/manuals is not easy
IMO. The key to good searching is in knowing what one should be
searching for. Not an easy thing for a newbie. I have however come
across a GUI approach so fortunately this issue is less of a problem
for me now.

>>>if
>>>you do a search on "load data infile MySQL" the first match you get is=
what
>>>you need: http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html

Knowing what one should be searching for is a great help. Many thanks
for your guidance/patience.

< snip >

>All MySQL executables are in your /bin directory,=20

Okay. Thanks.

>where they can be reached by command prompt,=20

Not so easy if it is on one's hosting server. I have had minimal
experience with Telnet clients.

>they'll give you their syntax, and the manual=20
>will tell you exactly what each command will do. The mysqlimport client=20
>is the "mysqlimport" binary, that was designed to load data into MySQL=20
>from a number of different sources.

Okay.

< snip >

>If you already have a table, you can export its definition and data in=20
>form of a .sql file, that when imported, will create and populate the=20
>table,

That's what I had thought.

< snip >=20

Thanks again for taking the time to explain things. It certainly helps
and is appreciated.

Regards, John.


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org

Re: Steps to importing table data.

am 05.12.2004 08:11:56 von johnf

On Sun, 05 Dec 2004 10:55:45 +1100, John Fitzsimons wrote:
=20
>On Mon, 22 Nov 2004 11:50:38 -0300, Daniel da Veiga wrote:

< snip >

>Going through hundreds of pages of instructions/manuals is not easy
>IMO. The key to good searching is in knowing what one should be
>searching for. Not an easy thing for a newbie. I have however come
>across a GUI approach so fortunately this issue is less of a problem
>for me now.

< snip >

This is rather odd. Talking to myself. :-) But Daniel suggested
(privately) that I mention on the list the program that I was talking
about. I am mainly using it for the search functions but there is also
an import tool on the site as well.

Here it is ;

http://www.dbqwiksite.com/

Regards, John.


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org

Re: Steps to importing table data.

am 06.12.2004 00:47:16 von GRAEME F ST CLAIR

I absolutely agree poking thru long complicated manuals is a pain when you
don't know what you're looking for - that's why I still prefer paper.
Naturally, I too have these "the older I get" feelings...

However, I assure you the MySQL doc is of high standard, and does cover
"everything you wanted to know but were afraid to ask". A technique I've
found useful with it is to have both the Table of Contents and the main body
of the manual as files on my computer, and as links from "Favorites" in my
browser. Use the one-lump HTML form for the main body. Then do a 'find' in
the ToC for a word of interest e.g. SELECT, and be sure to 'find' using
'match whole words only' and 'match case'. This will probably find you the
right pointer. If not, then apply the same technique to the main body.

I also use that fine editor TextPad, which has a natty 'Find in Files'
feature. Here's an example from a search I did (on a multi-chapter version
of the main body) only a couple of days ago. I was looking for the string
'host='.

many lines omitted
manual_Replication.html(2004):

--report-host=host
manual_Replication.html(2308): -> MASTER_HOST='master_host_name',
manual_Replication.html(2780): TO MASTER_HOST='S1' (where
'S1' represents the real hostname of
manual_SQL_Syntax.html(7199): -> WHERE User='user_name' and
Host='host_name';
manual_SQL_Syntax.html(7536): mysql> DELETE FROM mysql.user WHERE
Host='localhost' AND User='';
manual_SQL_Syntax.html(7943): -> WHERE User='bob' AND Host='%.loc.gov';
manual_SQL_Syntax.html(11081): Any slave not started with the
--report-host=slave_name
manual_SQL_Syntax.html(11249): ->
MASTER_HOST='master2.mycompany.com',
manual_SQL_Syntax.html(11299): -> MASTER_HOST='some_dummy_string';
manual_Using_MySQL_Programs.html(274): For example, -h
localhost
or --host=localhost indicate
manual_Using_MySQL_Programs.html(495): --host=localhost on the
command line should be specified as
manual_Using_MySQL_Programs.html(496): quick or
host=localhost in an option file.
Found 42 occurrence(s) in 10 file(s)

The really neat thing is that TextPad shows you the search results in a new
document, and you can double-click on the file name & line no in any line,
and go straight there. For 30 USD, I'd buy it for that alone!

HTH, GStC.


----- Original Message -----
From: "John Fitzsimons"
To:
Sent: Sunday, December 05, 2004 2:11 AM
Subject: Re: Steps to importing table data.


On Sun, 05 Dec 2004 10:55:45 +1100, John Fitzsimons wrote:

>Going through hundreds of pages of instructions/manuals is not easy
>IMO. The key to good searching is in knowing what one should be
>searching for. Not an easy thing for a newbie. I have however come
>across a GUI approach so fortunately this issue is less of a problem
>for me now.



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Re: Steps to importing table data.

am 08.12.2004 14:56:11 von Fred Friedman

I convert most of my online manuals into .PDFs. I keep multi-files open
in adobe acrobat with the search window open. When searching for a
particular suspect word, the search will show every instance of the
word. A simple click will show that section of the manual. The split
window capabilities allows many sections of the manual to show at one time.

Fred Friedman
Engineering Strategies Inc.



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Help with using Text and Blob types

am 08.12.2004 23:26:19 von Danny Willis

I have a site with a form that takes in a message. At the moment I have it
set as a VARCHAR but it isn't large enough. What's the trick to changing
the type to a Text Type of Blob type and working with it? I've read the
documentation but I still really don't understand what I need to change in
my queries to work with these types.

This is a priority so any help is greatly appreciated.

Thanks.


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

RE: Help with using Text and Blob types

am 08.12.2004 23:33:50 von Danny Willis

I'm using php, not asp/vb.


-----Original Message-----
From: James Frankman [mailto:jfrankman@idfbins.com]
Sent: Wednesday, December 08, 2004 5:34 PM
To: Danny Willis
Subject: RE: Help with using Text and Blob types

Assuming you are using vb or asp, this article help me out:
http://dev.mysql.com/tech-resources/articles/vb-blob-handlin g.html

-----Original Message-----
From: Danny Willis [mailto:danny.willis@project-wildfire.com]
Sent: Wednesday, December 08, 2004 3:26 PM
To: win32@lists.mysql.com
Subject: Help with using Text and Blob types


I have a site with a form that takes in a message. At the moment I have it
set as a VARCHAR but it isn't large enough. What's the trick to changing
the type to a Text Type of Blob type and working with it? I've read the
documentation but I still really don't understand what I need to change in
my queries to work with these types.

This is a priority so any help is greatly appreciated.

Thanks.


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=jfrankman@idfbins.com



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

RE: Help with using Text and Blob types

am 08.12.2004 23:47:50 von Randy Clamons

Danny, =


If you are storing text, make the column type text--depending on how much d=
ata you are storing, you may prefer tinytext, text, mediumtext or longtext.=
Then you just need to mysql_escape_string() before saving to db.

Reference for mysql_escape_string(): http://us2.php.net/manual/en/function.=
mysql-escape-string.php

Randy Clamons
Systems Programming
Astro-auction.com


> ------------Original Message------------
> From: "Danny Willis"
> To: "'James Frankman'" , win32@lists.mysql.com
> Date: Wed, Dec-8-2004 3:36 PM
> Subject: RE: Help with using Text and Blob types
>
> =

> I'm using php, not asp/vb.
> =

> =

> -----Original Message-----
> From: James Frankman [mailto:jfrankman@idfbins.com] =

> Sent: Wednesday, December 08, 2004 5:34 PM
> To: Danny Willis
> Subject: RE: Help with using Text and Blob types
> =

> Assuming you are using vb or asp, this article help me out:
> http://dev.mysql.com/tech-resources/articles/vb-blob-handlin g.html
> =

> -----Original Message-----
> From: Danny Willis [mailto:danny.willis@project-wildfire.com]
> Sent: Wednesday, December 08, 2004 3:26 PM
> To: win32@lists.mysql.com
> Subject: Help with using Text and Blob types
> =

> =

> I have a site with a form that takes in a message. At the moment I =

> have it
> set as a VARCHAR but it isn't large enough. What's the trick to =

> changing
> the type to a Text Type of Blob type and working with it? I've read =

> the
> documentation but I still really don't understand what I need to change =

> in
> my queries to work with these types.
> =

> This is a priority so any help is greatly appreciated.
> =

> Thanks.
> =

> =



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org

RE: Help with using Text and Blob types

am 15.12.2004 03:35:19 von Danny Willis

Ok,

Is this all I need to do to store the data. What about reading it back out
of the database?

-----Original Message-----
From: Randy Clamons [mailto:randy@novaspace.com]
Sent: Wednesday, December 08, 2004 5:48 PM
To: Danny Willis; win32@lists.mysql.com
Subject: RE: Help with using Text and Blob types

Danny,

If you are storing text, make the column type text--depending on how much
data you are storing, you may prefer tinytext, text, mediumtext or longtext.
Then you just need to mysql_escape_string() before saving to db.

Reference for mysql_escape_string():
http://us2.php.net/manual/en/function.mysql-escape-string.ph p

Randy Clamons
Systems Programming
Astro-auction.com


> ------------Original Message------------
> From: "Danny Willis"
> To: "'James Frankman'" , win32@lists.mysql.com
> Date: Wed, Dec-8-2004 3:36 PM
> Subject: RE: Help with using Text and Blob types
>
>
> I'm using php, not asp/vb.
>
>
> -----Original Message-----
> From: James Frankman [mailto:jfrankman@idfbins.com]
> Sent: Wednesday, December 08, 2004 5:34 PM
> To: Danny Willis
> Subject: RE: Help with using Text and Blob types
>
> Assuming you are using vb or asp, this article help me out:
> http://dev.mysql.com/tech-resources/articles/vb-blob-handlin g.html
>
> -----Original Message-----
> From: Danny Willis [mailto:danny.willis@project-wildfire.com]
> Sent: Wednesday, December 08, 2004 3:26 PM
> To: win32@lists.mysql.com
> Subject: Help with using Text and Blob types
>
>
> I have a site with a form that takes in a message. At the moment I
> have it
> set as a VARCHAR but it isn't large enough. What's the trick to
> changing
> the type to a Text Type of Blob type and working with it? I've read
> the
> documentation but I still really don't understand what I need to change
> in
> my queries to work with these types.
>
> This is a priority so any help is greatly appreciated.
>
> Thanks.
>
>



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

RE: Help with using Text and Blob types

am 15.12.2004 04:17:31 von Randy Clamons

Danny,

That depends on what you are going to do with the text that comes out. When=
you retrieve the text, the special characters will not be escaped. In othe=
r words, it will include quotes, apostrophes, new line characters, etc.

You're using php, so I will guess you are putting the text on an html form.=
As long as the retrieved text is going between the tags tag. This happens to me when I am saving html in the text col=
umn. In that case, I have to translate the textarea tags within the text to=
something else when displaying the form, and remember to translate it back=
when saving to the db.

If you are simply displaying the conent on your html page, you don't need t=
o worry about a thing!

Let me know how it comes out.

Randy Clamons
Systems Programming
Astro-auction.com


> ------------Original Message------------
> From: "Danny Willis"
> To: randy@novaspace.com, win32@lists.mysql.com
> Date: Tue, Dec-14-2004 7:33 PM
> Subject: RE: Help with using Text and Blob types
>
> Ok,
> =

> Is this all I need to do to store the data. What about reading it back =

> out
> of the database?
> =

> -----Original Message-----
> From: Randy Clamons [mailto:randy@novaspace.com] =

> Sent: Wednesday, December 08, 2004 5:48 PM
> To: Danny Willis; win32@lists.mysql.com
> Subject: RE: Help with using Text and Blob types
> =

> Danny, =

> =

> If you are storing text, make the column type text--depending on how =

> much
> data you are storing, you may prefer tinytext, text, mediumtext or =

> longtext.
> Then you just need to mysql_escape_string() before saving to db.
> =

> Reference for mysql_escape_string():
> http://us2.php.net/manual/en/function.mysql-escape-string.ph p
> =

> Randy Clamons
> Systems Programming
> Astro-auction.com
> =

> =

> > ------------Original Message------------
> > From: "Danny Willis"
> > To: "'James Frankman'" , win32@lists.mysql.com
> > Date: Wed, Dec-8-2004 3:36 PM
> > Subject: RE: Help with using Text and Blob types
> >
> > =

> > I'm using php, not asp/vb.
> > =

> > =

> > -----Original Message-----
> > From: James Frankman [mailto:jfrankman@idfbins.com] =

> > Sent: Wednesday, December 08, 2004 5:34 PM
> > To: Danny Willis
> > Subject: RE: Help with using Text and Blob types
> > =

> > Assuming you are using vb or asp, this article help me out:
> > http://dev.mysql.com/tech-resources/articles/vb-blob-handlin g.html
> > =

> > -----Original Message-----
> > From: Danny Willis [mailto:danny.willis@project-wildfire.com]
> > Sent: Wednesday, December 08, 2004 3:26 PM
> > To: win32@lists.mysql.com
> > Subject: Help with using Text and Blob types
> > =

> > =

> > I have a site with a form that takes in a message. At the moment I =

> > have it
> > set as a VARCHAR but it isn't large enough. What's the trick to =

> > changing
> > the type to a Text Type of Blob type and working with it? I've read =

> > the
> > documentation but I still really don't understand what I need to =

> change =

> > in
> > my queries to work with these types.
> > =

> > This is a priority so any help is greatly appreciated.
> > =

> > Thanks.
> > =

> > =

> =

> =

> =

> -- =

> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> To unsubscribe: =

> http://lists.mysql.com/win32?unsub=3Drandy@novaspace.com
> =

> =



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org

RE: Help with using Text and Blob types

am 15.12.2004 04:30:07 von Danny Willis

Ah! Ok. Now I understand. Thank you very much Randy. I now have it up
and working and thanks to your reply I now understand exactly what is going
on.

Much appreciated!

Dan

-----Original Message-----
From: Randy Clamons [mailto:randy@novaspace.com]
Sent: Tuesday, December 14, 2004 10:18 PM
To: Danny Willis; win32@lists.mysql.com
Subject: RE: Help with using Text and Blob types

Danny,

That depends on what you are going to do with the text that comes out. When
you retrieve the text, the special characters will not be escaped. In other
words, it will include quotes, apostrophes, new line characters, etc.

You're using php, so I will guess you are putting the text on an html form.
As long as the retrieved text is going between the tags on any form, you won't need to do a thing for it to display
properly on the form. The only problem you could see is if the saved text
includes the tag. This happens to me when I am saving html in
the text column. In that case, I have to translate the textarea tags within
the text to something else when displaying the form, and remember to
translate it back when saving to the db.

If you are simply displaying the conent on your html page, you don't need to
worry about a thing!

Let me know how it comes out.

Randy Clamons
Systems Programming
Astro-auction.com


> ------------Original Message------------
> From: "Danny Willis"
> To: randy@novaspace.com, win32@lists.mysql.com
> Date: Tue, Dec-14-2004 7:33 PM
> Subject: RE: Help with using Text and Blob types
>
> Ok,
>
> Is this all I need to do to store the data. What about reading it back
> out
> of the database?
>
> -----Original Message-----
> From: Randy Clamons [mailto:randy@novaspace.com]
> Sent: Wednesday, December 08, 2004 5:48 PM
> To: Danny Willis; win32@lists.mysql.com
> Subject: RE: Help with using Text and Blob types
>
> Danny,
>
> If you are storing text, make the column type text--depending on how
> much
> data you are storing, you may prefer tinytext, text, mediumtext or
> longtext.
> Then you just need to mysql_escape_string() before saving to db.
>
> Reference for mysql_escape_string():
> http://us2.php.net/manual/en/function.mysql-escape-string.ph p
>
> Randy Clamons
> Systems Programming
> Astro-auction.com
>
>
> > ------------Original Message------------
> > From: "Danny Willis"
> > To: "'James Frankman'" , win32@lists.mysql.com
> > Date: Wed, Dec-8-2004 3:36 PM
> > Subject: RE: Help with using Text and Blob types
> >
> >
> > I'm using php, not asp/vb.
> >
> >
> > -----Original Message-----
> > From: James Frankman [mailto:jfrankman@idfbins.com]
> > Sent: Wednesday, December 08, 2004 5:34 PM
> > To: Danny Willis
> > Subject: RE: Help with using Text and Blob types
> >
> > Assuming you are using vb or asp, this article help me out:
> > http://dev.mysql.com/tech-resources/articles/vb-blob-handlin g.html
> >
> > -----Original Message-----
> > From: Danny Willis [mailto:danny.willis@project-wildfire.com]
> > Sent: Wednesday, December 08, 2004 3:26 PM
> > To: win32@lists.mysql.com
> > Subject: Help with using Text and Blob types
> >
> >
> > I have a site with a form that takes in a message. At the moment I
> > have it
> > set as a VARCHAR but it isn't large enough. What's the trick to
> > changing
> > the type to a Text Type of Blob type and working with it? I've read
> > the
> > documentation but I still really don't understand what I need to
> change
> > in
> > my queries to work with these types.
> >
> > This is a priority so any help is greatly appreciated.
> >
> > Thanks.
> >
> >
>
>
>
> --
> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> To unsubscribe:
> http://lists.mysql.com/win32?unsub=randy@novaspace.com
>
>



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org