Forums

PHP

This topic is locked

php Server-Model->Default Values for insert???!

Posted 13 Jan 2003 09:10:25
1
has voted
13 Jan 2003 09:10:25 st f posted:
Hi folks,
does anyone know, if it is possible to use default values or mysql-Functions with an insert/update?! I'm using the php-ServerModel and want to enter the current Date using now() - but the insert-Record Dialog just allows me to enter values from the form, there is no possibility to give a custiom value - of course it is easy to patch the generated php code, but then i lose the editability via the various wizards - does anyone have any ideas?! Any Help appreciated!!!

greetings
stf

Replies

Replied 13 Jan 2003 10:29:08
13 Jan 2003 10:29:08 Iain Stewart replied:
Hi there,

can you not use a hidden field in your form and give that the value Now() , name the hidden field date or what ever your date field in your table is called and when you apply your insert update function to the page, assign the date hidden field to the date field in your table.

Hope that helps

Iain

head hurts, 'mental note to self, stop banging head !'
Replied 13 Jan 2003 11:43:36
13 Jan 2003 11:43:36 Julio Taylor replied:
What DB Server are you using? If you're using MySQL (or anything else but shitty Access) you'll be able to set a TIMESTAMP field, which will record a precise and reliable time figure, which can then be calculated, formatted and manipulated by both PHP and the DB Server....



------------------------
Julio

PHP | MySQL | UD4

ICQ: 19735247
Replied 13 Jan 2003 11:48:33
13 Jan 2003 11:48:33 st f replied:
Yes, i am using mysql, and this really solves my problems right now: Although i think its rather strange, that dw does not allow to hook in userdefined functions for updates/inserts... thanks for the help!
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
What DB Server are you using? If you're using MySQL (or anything else but shitty Access) you'll be able to set a TIMESTAMP field, which will record a precise and reliable time figure, which can then be calculated, formatted and manipulated by both PHP and the DB Server....



------------------------
Julio

PHP | MySQL | UD4

ICQ: 19735247
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Reply to this topic