Page 2 of 2
Posted: Sat Sep 25, 2004 11:01 am
by Mini-Me
ok, so I got the idea I needed something like this:
Field | Type | Null | Default
date | timestamp(14) | Yes | NULL
info | text | No |
(should the info part be text or varchar(255)??)
so.. does that look about right? That pdf wasn't that helpful, really. I got a basic understanding about databases, but that was about it.
Posted: Sat Sep 25, 2004 11:44 am
by feyd
text has an upper limit of 64K of text.. I'm pretty doubtful you'll go over 100 or more characters.. so using a varchar of some size would work well. Although, it pretty much doesn't hurt at all using text.
as for the date field, I'd suggest using an int, so you can store the unix timestamp with being able to easily format the date into whatever you desire down the road.
Posted: Sat Sep 25, 2004 12:25 pm
by Mini-Me
ah, ok. I didn't know that I could use something like a date with int, but ok.
*hmm* Ok, when I change it to INT, I get a number (14) there. Should that be something else or is that ok?
Ok, so now that I have this table here, how do I read and write information to it?
Posted: Sat Sep 25, 2004 12:51 pm
by feyd
the current unix timestamp is at maximum, int(11)...
as for writing and reading: [php_man]mysql_query[/php_man] has several examples. [mysql_man]select syntax[/mysql_man] for specifics of sql selection with mysql. read the hundreds of threads we have here in the databases section, you'll find lots and lots more examples of fetching (hint) the information found by a query.