You are here: Re: Put today's date into a MySQL "date" formated field « PHP Programming Language « IT news, forums, messages
Re: Put today's date into a MySQL "date" formated field

Posted by Chris Hope on 08/04/06 01:39

walterbyrd wrote:

> Chris Hope wrote:
>>
>> You need quotes around the date:
>
> Thanx. That did it.
> By the way, when putting together an sql statement, when do I use
> single quotes, and when do I use \"$var \" ?? Or does it matter?

With mysql you can use single quotes and double quotes interchangeably.
Other databases are not so tolerant.

>> or realise that now() is a SQL function and do:
>
> When I try t use now(), I get an undefined function error. I am using
> PHP 4.4, under windows, if that matters.

It's *not* a PHP function. It's a SQL function. So you put it in the SQL
query eg "INSERT INTO some_table (datefield) VALUES (now())"

--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация