PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue Sep 29, 2020 2:11 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Sat Sep 25, 2004 11:01 am 
Offline
Forum Commoner

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


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 25, 2004 11:44 am 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 25, 2004 12:25 pm 
Offline
Forum Commoner

Joined: Sun Sep 12, 2004 4:07 pm
Posts: 38
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?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 25, 2004 12:51 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group