drawing news from my site onto a png

Need help with Photoshop, the GIMP, Illustrator, or others? Want to show off your work? Looking for advice on your newest Flash stuff?

Moderator: General Moderators

Mini-Me
Forum Commoner
Posts: 38
Joined: Sun Sep 12, 2004 4:07 pm

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Mini-Me
Forum Commoner
Posts: 38
Joined: Sun Sep 12, 2004 4:07 pm

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply