Re: sysdate() query and note to Mysql admin

2001-09-07 Thread Ed Carp

[EMAIL PROTECTED] ([EMAIL PROTECTED]) writes:

> now,what statement do I use to put the sysdate into the column today?
> this is NOT working
> insert into datee values(select DAYOFMONTH(sysdate()));

Of course not. "insert into datee values (Now())" will, though. Just feed it
to mysql ... ;)

Here's the JavaScript euqivalent, if that helps:

function GetTheDate()
{
now = new Date;
ty = now.getYear();
if(ty < 1900)
{
ty = ty + 1900;
}
mo = now.getMonth();
mo = mo + 1;

return(ty+'-'+ShowZeroFilled(mo)+'-'+ShowZeroFilled(now.getD
ate())+'
'+ShowZeroFilled(now.getHours())+':'+ShowZeroFilled(now.getMinutes()));
}
--
Ed Carp, N7EKG  -  [EMAIL PROTECTED]  -  214/341-4420 -
http://www.pobox.com/~erc

Squished Mosquito, Inc.
Internet Applications Development
Escapade Server-Side Scripting Language Development Team
http://www.squishedmosquito.com
Pensacola - Dallas - Dresden - London


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




ODP: sysdate() query and note to Mysql admin

2001-09-07 Thread Daniel Łaś

Hi

First of all try to use datetime column for date&time storage porpouses.
create table datee(datetime today);
And then:
insert into datee(today) values(now());

After all of this, please RTFM :)). It's all written there.

Regards

Daniel Łaś
e-direct Polska sp. z o.o.
WWW: http://www.e-direct.pl
E-mail: [EMAIL PROTECTED]
45-072 Opole ul. Reymonta 45
tel. +48 77 44 26 073
fax. +48 77 44 26 074


> -Oryginalna wiadomość-
> Od: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Wysłano: 7 września 2001 15:51
> Do: [EMAIL PROTECTED]
> Temat: sysdate() query and note to Mysql admin
>
>
>
> Hi,
> I my name is ryan and I own a small site which has a mysql
> database and servlet support.
>
> I have a simple query to all you mysql gurus...
> my table is very simple, i created a table with the following
> create table datee(int today);
>
> now,what statement do I use to put the sysdate into the column today?
> this is NOT working
> insert into datee values(select DAYOFMONTH(sysdate()));
> the reason why I am doing this is coz I need to get the current
> date into my java app and this is not working
>
> 
> Statement statement;
> Resultset rs=statement.executeQuery("select DAYOFMONTH(sysdate())");
> if(rs.next())
> {rs.getString(sysdate());}
> ...
>
> does anyone know how to get the current date,month from the
> database into your java program?
>
> Please reply to [EMAIL PROTECTED] as I am unable to get into the mysql list.
> Any help appreciated.
> -Ryan.
>
> NOTE TO MySql admins
> 
> Why in the world am I not able to get into the MySql list?
> my email is [EMAIL PROTECTED] and everytime I subscribe I get an
> error telling me that this is a perminant error and that its
> given up on it.
> Kindly help or manually include me into the list please.
>
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




sysdate() query and note to Mysql admin

2001-09-07 Thread ryan


Hi,
I my name is ryan and I own a small site which has a mysql database and servlet 
support.

I have a simple query to all you mysql gurus...
my table is very simple, i created a table with the following
create table datee(int today);

now,what statement do I use to put the sysdate into the column today?
this is NOT working
insert into datee values(select DAYOFMONTH(sysdate()));
the reason why I am doing this is coz I need to get the current date into my java app 
and this is not working


Statement statement;
Resultset rs=statement.executeQuery("select DAYOFMONTH(sysdate())");
if(rs.next())
{rs.getString(sysdate());}  
...

does anyone know how to get the current date,month from the database into your java 
program?

Please reply to [EMAIL PROTECTED] as I am unable to get into the mysql list.
Any help appreciated.
-Ryan.

NOTE TO MySql admins

Why in the world am I not able to get into the MySql list?
my email is [EMAIL PROTECTED] and everytime I subscribe I get an error telling me that 
this is a perminant error and that its given up on it.
Kindly help or manually include me into the list please.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php