datatype for storing files, or is it better to store dir path only?

datatype for storing files, or is it better to store dir path only?

am 28.02.2005 05:42:39 von Phil Jones

MySQL Tool: Query Browser - table editor
O/S: Win2003 Server
Issue: I'm creating a table for storing actual .jpg
files. What datatype do I use for the column that will
actually house the files? Or is it better to store
only the directory path to the files and have the
files outside of the database?

Thanks,
-PJ

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.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: datatype for storing files, or is it better to store dir path only?

am 28.02.2005 07:08:50 von Dijital

Use the Binary Large Object field type (BLOB) if you want to store the
files in the database itself. However I would recommend you take the
second choice and store the directory path only. Storing BLOBs can
impact the performance of your database whereas the paths only will keep
it running leaner and more efficient. Cheers.

Armando

Phil Jones wrote:
> MySQL Tool: Query Browser - table editor
> O/S: Win2003 Server
> Issue: I'm creating a table for storing actual .jpg
> files. What datatype do I use for the column that will
> actually house the files? Or is it better to store
> only the directory path to the files and have the
> files outside of the database?
>
> Thanks,
> -PJ
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.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

Time formatting

am 11.04.2005 17:17:09 von Danny Willis

Time is stored in a 24 hour format in the database but I need to translate
to a normal 12 hour am/pm format. I am looking through the documentation
for an easy solution to this but I am not having much luck.

Do I need to manually convert the time from 24 hour to 12 hour or are there
some nice mysql functions or php functions that will do this easily for me?

Thanks in advance.


--
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: Time formatting

am 11.04.2005 18:13:42 von Markus Grossrieder

------=_NextPart_000_013B_01C53EC2.314E26B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Danny,=20

> Time is stored in a 24 hour format in the database but I need to =
translate
> to a normal 12 hour am/pm format. I am looking through the =
documentation
> for an easy solution to this but I am not having much luck.

I don't think that anybody outside of the US of A considers the AM/PM =
format as 'normal' ...

As for the date/time formatting, you'll find it at=20

http://dev.mysql.com/doc/mysql/en/date-and-time-functions.ht ml

You have to scroll down a bit to find the following:



DATE_FORMAT(date,format)=20

Formats the date value according to the format string. The following =
specifiers may be used in the format string:=20

Specifier Description =20
%a Abbreviated weekday name (Sun..Sat) =20
%b Abbreviated month name (Jan..Dec) =20
%c Month, numeric (0..12) =20
%D Day of the month with English suffix (0th, 1st, 2nd, 3rd, ...) =

%d Day of the month, numeric (00..31) =20
%e Day of the month, numeric (0..31) =20
%f Microseconds (000000..999999) =20
%H Hour (00..23) =20
%h Hour (01..12) =20
%I Hour (01..12) =20
%i Minutes, numeric (00..59) =20
%j Day of year (001..366) =20
%k Hour (0..23) =20
%l Hour (1..12) =20
%M Month name (January..December) =20
%m Month, numeric (00..12) =20
%p AM or PM =20
%r Time, 12-hour (hh:mm:ss followed by AM or PM) =20
%S Seconds (00..59) =20
%s Seconds (00..59) =20
%T Time, 24-hour (hh:mm:ss) =20
%U Week (00..53), where Sunday is the first day of the week =20
%u Week (00..53), where Monday is the first day of the week =20
%V Week (01..53), where Sunday is the first day of the week; used =
with %X =20
%v Week (01..53), where Monday is the first day of the week; used =
with %x =20
%W Weekday name (Sunday..Saturday) =20
%w Day of the week (0=3DSunday..6=3DSaturday) =20
%X Year for the week where Sunday is the first day of the week, =
numeric, four digits; used with %V =20
%x Year for the week, where Monday is the first day of the week, =
numeric, four digits; used with %v =20
%Y Year, numeric, four digits =20
%y Year, numeric, two digits =20
%% A literal '%'. =20

All other characters are copied to the result without interpretation.=20

The %v, %V, %x, and %X format specifiers are available as of MySQL =
3.23.8. %f is available as of MySQL 4.1.1.=20

As of MySQL 3.23, the '%' character is required before format specifier =
characters. In earlier versions of MySQL, '%' was optional.=20

The reason the ranges for the month and day specifiers begin with zero =
is that MySQL allows incomplete dates such as '2004-00-00' to be stored =
as of MySQL 3.23.=20



mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00', '%W %M %Y');
-> 'Saturday October 1997'
mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00', '%H:%i:%s');
-> '22:23:00'
mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00',
'%D %y %a %d %m %b %j');
-> '4th 97 Sat 04 10 Oct 277'
mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00',
'%H %k %I %r %T %S %w');
-> '22 22 10 10:23:00 PM 22:23:00 00 6'
mysql> SELECT DATE_FORMAT('1999-01-01', '%X %V');
-> '1998 52'






Kind regards,=20
Markus



----- Original Message -----=20
From: "Danny Willis"
To:
Sent: Monday, April 11, 2005 5:17 PM
Subject: Time formatting


> Time is stored in a 24 hour format in the database but I need to =
translate
> to a normal 12 hour am/pm format. I am looking through the =
documentation
> for an easy solution to this but I am not having much luck.
>=20
> Do I need to manually convert the time from 24 hour to 12 hour or are =
there
> some nice mysql functions or php functions that will do this easily =
for me?
>=20
> Thanks in advance.
>=20
>=20
> --=20
> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> To unsubscribe: =
http://lists.mysql.com/win32?unsub=3Dmarkus.grossrieder@alba -systems.com
>=20
>
------=_NextPart_000_013B_01C53EC2.314E26B0--

Re: Time formatting

am 11.04.2005 18:19:00 von Daniel da Veiga

I trully believe there's an answer at the MySQL Manual, page 623 and 624.
RTFM and you'll be able to change the way MySQL returns the time,
using DATE_FORMAT.

Good luck,

On Apr 11, 2005 12:17 PM, Danny Willis
wrote:
> Time is stored in a 24 hour format in the database but I need to translate
> to a normal 12 hour am/pm format. I am looking through the documentation
> for an easy solution to this but I am not having much luck.
>
> Do I need to manually convert the time from 24 hour to 12 hour or are there
> some nice mysql functions or php functions that will do this easily for me?
>
> Thanks in advance.
>
> --
> 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: Time formatting

am 11.04.2005 20:41:11 von Daniel da Veiga

I'm pretty sorry if he took my comment as an offense, RTFM is just a
way of saying that he needs to download and check the manual before
posting to the list, its a basic of the "How to ask questions"
netiquette. Some people (like me) do not take it as offensive, at
least not when the person even put the page of the manual concerning
your question.

Sorry again if I'll be rude, but it took me 30 seconds to find that at
the manual, simply looking for the word "TIME" (cause I forgot the
exact syntax of the DATE_FORMAT function). I do think that instead of
giving the fish, someone that really wanna help will teach the person
how to fish by himself.

There's no need to extend this question further, my apologies to Danny
and any other member that may find my mail offensive.

On Apr 11, 2005 2:18 PM, Rick Faircloth wrote:
>
> Daniel...
>
> In an otherwise good answer was "RTFM" necessary?
> He had already stated that he was looking at the documentation,
> but not having much luck finding anything...
>
> Rick
>
>
> > -----Original Message-----
> > From: Daniel da Veiga [mailto:danieldaveiga@gmail.com]
> > Sent: Monday, April 11, 2005 12:19 PM
> > To: MySQL Win32 List
> > Subject: Re: Time formatting
> >
> >
> > I trully believe there's an answer at the MySQL Manual, page 623 and 624.
> > RTFM and you'll be able to change the way MySQL returns the time,
> > using DATE_FORMAT.
> >
> > Good luck,
> >
> > On Apr 11, 2005 12:17 PM, Danny Willis
> > wrote:
> > > Time is stored in a 24 hour format in the database but I need
> > to translate
> > > to a normal 12 hour am/pm format. I am looking through the
> > documentation
> > > for an easy solution to this but I am not having much luck.
> > >
> > > Do I need to manually convert the time from 24 hour to 12 hour
> > or are there
> > > some nice mysql functions or php functions that will do this
> > easily for me?
> > >
> > > Thanks in advance.
> > >
> > > --
> > > 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=Rick@golibertyonline.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: Time formatting

am 11.04.2005 22:52:24 von Dijital

And FYI, you would use the DATE_FORMAT function in your query... ie;

select DATE_FORMAT(database_field_name,'%W, %M %D, %Y') AS
new_variable_name from table_name

The above when you displayed the contents of the new variable
new_variable_name would display (based on the date in the table being
2005-04-11):

Monday, April 11, 2005

Cheers.

Armando

Daniel da Veiga wrote:
> I trully believe there's an answer at the MySQL Manual, page 623 and 624.
> RTFM and you'll be able to change the way MySQL returns the time,
> using DATE_FORMAT.
>
> Good luck,
>
> On Apr 11, 2005 12:17 PM, Danny Willis
> wrote:
>
>>Time is stored in a 24 hour format in the database but I need to translate
>>to a normal 12 hour am/pm format. I am looking through the documentation
>>for an easy solution to this but I am not having much luck.
>>
>>Do I need to manually convert the time from 24 hour to 12 hour or are there
>>some nice mysql functions or php functions that will do this easily for me?
>>
>>Thanks in advance.
>>
>>--
>>MySQL Windows Mailing List
>>For list archives: http://lists.mysql.com/win32
>>To unsubscribe: http://lists.mysql.com/win32?unsub=danieldaveiga@gmail.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