yy - 2 digit representation of year
yyyy - ful numeric representation of year
m - numeric representation of month, without leading zero
mm - numeric representation of month, with leading zero
mmm - short textual representation of month =20
d - day of month without leading zero
dd - day of month with leadin zero
>"Ng Hwee Hwee" wrote in message
news:009801c484f1$d11c8af0$800101df@hweehwee...
>Hi all,
>
>can someone kindly point me to a resource that converts all kinds of
possible date inputs into MySQL format of YYYY-MM-DD?
>
>example of formats to be converted includes:
>
>d/m/yy
>d/m/yyyy
>d/mm/yy
>d/mm/yyy
>dd/mm/yy
>dd/mm/yyy
>d/mmm/yy
>d/mmm/yyyy
>dd/mmm/yy
>dd/mmm/yyyy
>
>yy - 2 digit representation of year
>yyyy - ful numeric representation of year
>m - numeric representation of month, without leading zero
>mm - numeric representation of month, with leading zero
>mmm - short textual representation of month
>d - day of month without leading zero
>dd - day of month with leadin zero
>
>thanx!
>
>hwee
This question belongs more to the general list, but anyway:
You can use strtotime() to convert various formats to a timestamp. Then use
date() to convert it back to your preferred date format:
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Check Boxes
am 18.08.2004 10:59:28 von balwantsingh
can somebody advise me
i want to use checkboxes on my website, i want that if user selects some
checkboxes (there will be more than 20 checkboxes), checkbox's value will be
stored in variables and than SELECT query command will be run using these
variables through PHP. but my problem is that in SELECT query command after
each column name comma (,) is required and if i use the same than it is
displaying "You have an error in your SQL syntax near 'FROM form' at line
1"
pls. help.
balwant
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
if ($a1 or $a2 or $a3) {
$query = "SELECT $a1, $a2, $a3 FROM form";
$result=@mysql_query ($query);
}
Enter_Date
Opening_Units
Unit_Consumed
-----Original Message-----
From: John Holmes [mailto:holmes072000@charter.net]
Sent: Wednesday, August 18, 2004 5:43 PM
To: balwantsingh@indoasian.com
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Check Boxes
balwantsingh wrote:
> can somebody advise me
> i want to use checkboxes on my website, i want that if user selects some
> checkboxes (there will be more than 20 checkboxes), checkbox's value will
be
> stored in variables and than SELECT query command will be run using these
> variables through PHP. but my problem is that in SELECT query command
after
> each column name comma (,) is required and if i use the same than it is
> displaying "You have an error in your SQL syntax near 'FROM form' at line
> 1"
How about showing us some code.... kind of hard to help without that...
php|architect: The Magazine for PHP Professionals www.phparch.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-GEN] Check Boxes
am 18.08.2004 11:32:56 von balwantsingh
balwantsingh wrote:
> can somebody advise me
> i want to use checkboxes on my website, i want that if user selects some
> checkboxes (there will be more than 20 checkboxes), checkbox's value will
be
> stored in variables and than SELECT query command will be run using these
> variables through PHP. but my problem is that in SELECT query command
after
> each column name comma (,) is required and if i use the same than it is
> displaying "You have an error in your SQL syntax near 'FROM form' at line
> 1"
On Wed, 18 Aug 2004 15:01:01 +0530, balwantsingh wrote:
> i am using following coding
>=20
> $a1 =3D $_POST['ch1'];
> $a2 =3D $_POST['ch2'];
> $a3 =3D $_POST['ch3'];
>=20
> if ($a1 or $a2 or $a3) {
> $query =3D "SELECT $a1, $a2, $a3 FROM form";
> $result=3D@mysql_query ($query);
> }
> Enter_Date
> Opening_Units
">
> Unit_Consumed
">
>=20
>=20
>=20
>=20
> -----Original Message-----
> From: John Holmes [mailto:holmes072000@charter.net]
> Sent: Wednesday, August 18, 2004 5:43 PM
> To: balwantsingh@indoasian.com
> Cc: php-db@lists.php.net
> Subject: Re: [PHP-DB] Check Boxes
>=20
> balwantsingh wrote:
> > can somebody advise me
> > i want to use checkboxes on my website, i want that if user selects som=
e
> > checkboxes (there will be more than 20 checkboxes), checkbox's value wi=
ll
> be
> > stored in variables and than SELECT query command will be run using the=
se
> > variables through PHP. but my problem is that in SELECT query command
> after
> > each column name comma (,) is required and if i use the same than it is
> > displaying "You have an error in your SQL syntax near 'FROM form' at l=
ine
> > 1"
>=20
> How about showing us some code.... kind of hard to help without that...
>=20
> --
>=20
> ---John Holmes...
>=20
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>=20
> php|architect: The Magazine for PHP Professionals â=93 www.phparch.c=
om
>=20
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>=20
>=20
--=20
randy sesser@gmail.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Check Boxes
am 18.08.2004 14:12:30 von John Holmes
balwantsingh wrote:
> can somebody advise me
> i want to use checkboxes on my website, i want that if user selects some
> checkboxes (there will be more than 20 checkboxes), checkbox's value will be
> stored in variables and than SELECT query command will be run using these
> variables through PHP. but my problem is that in SELECT query command after
> each column name comma (,) is required and if i use the same than it is
> displaying "You have an error in your SQL syntax near 'FROM form' at line
> 1"
How about showing us some code.... kind of hard to help without that...
php|architect: The Magazine for PHP Professionals www.phparch.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: Date Conversion
am 18.08.2004 15:23:32 von Paul
You might want to look into date conversion on the MySQL side:
http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.ht ml
Look for
DATE_FORMAT(date,format)
Paul
On Wed, 18 Aug 2004 10:16:59 +0200, Torsten Roehr wrote:
> >"Ng Hwee Hwee" wrote in message
> news:009801c484f1$d11c8af0$800101df@hweehwee...
>
>
> >Hi all,
> >
> >can someone kindly point me to a resource that converts all kinds of
> possible date inputs into MySQL format of YYYY-MM-DD?
> >
> >example of formats to be converted includes:
> >
> >d/m/yy
> >d/m/yyyy
> >d/mm/yy
> >d/mm/yyy
> >dd/mm/yy
> >dd/mm/yyy
> >d/mmm/yy
> >d/mmm/yyyy
> >dd/mmm/yy
> >dd/mmm/yyyy
> >
> >yy - 2 digit representation of year
> >yyyy - ful numeric representation of year
> >m - numeric representation of month, without leading zero
> >mm - numeric representation of month, with leading zero
> >mmm - short textual representation of month
> >d - day of month without leading zero
> >dd - day of month with leadin zero
> >
> >thanx!
> >
> >hwee
>
> This question belongs more to the general list, but anyway:
>
> You can use strtotime() to convert various formats to a timestamp. Then use
> date() to convert it back to your preferred date format:
>
> $timestamp = strtotime($inputDate);
> $isoDate = date('Y-m-d', $timestamp);
>
> http://de2.php.net/strtotime
> http://de2.php.net/manual/en/function.date.php
>
> Regards, Torsten Roehr
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php