Welcome Guest, Not a member yet? Register   Sign In
need to find all records with 2009 from a date string of XX/XX/XXXX
#11

[eluser]Flying Fish[/eluser]
this might sound so lazy, but I just dont get the whole mysql time stamp thing, and what I need is not so mission critical that it merits spending a lot of time on

looking at dates that make sense is so much easier for me
#12

[eluser]jedd[/eluser]
[quote author="Flying Fish" date="1250302247"]this might sound so lazy, but I just dont get the whole mysql time stamp thing, and what I need is not so mission critical that it merits spending a lot of time on

looking at dates that make sense is so much easier for me[/quote]

Note that for about 96% of humans, the date format you're using doesn't make any sense. At least with the MSB approach - as described by ISO8601, and as used by MySQL in its various DATE fields - the problem you're now having .. doesn't happen.

It might be worth the time (I'd guess about 10 minutes of reading) as I reckon it'll save you from other troubles in the future.
#13

[eluser]Flying Fish[/eluser]
Maybe I could find some video training...will the mysql date field update every time you access the record or can it just be set once the first time the record was created
#14

[eluser]jedd[/eluser]
[quote author="Flying Fish" date="1250304526"]Maybe I could find some video training...will the mysql date field update every time you access the record or can it just be set once the first time the record was created[/quote]

It's just another data type - one that's convenient for storing time information. You should read up on DATETIME, DATE and TIMESTAMP field types (for MySQL).

You can set it (at creation, or any time subsequent) using SQL's NOW() function. But unless you change it intentionally, as with your VARCHARs, INTs, and so on - the content of that field won't change by itself.
#15

[eluser]Jondolar[/eluser]
[quote author="Flying Fish" date="1250304526"]Maybe I could find some video training...will the mysql date field update every time you access the record or can it just be set once the first time the record was created[/quote]

The first timestamp field in a record will be updated with the current date/time every time a record is modified. No other field does this so you can use a datetime field without any problems.

If you do every decide to use a timestamp field and don't want the auto-update, you can create two timestamp fields and just use the second field while mysql updates the first one. This may have changed in newer versions. I don't use timestamp fields much any more.




Theme © iAndrew 2016 - Forum software by © MyBB