database querying question
Moderator: General Moderators
database querying question
ok. i'm about to implement a dabase and enter the next stage of testing a site i'm making.
i have aquestion before i do ... when i connect to the mysql database, if the user can only use one databse, do i need to select a db orr is it automatically selected???
thanx in advance
i have aquestion before i do ... when i connect to the mysql database, if the user can only use one databse, do i need to select a db orr is it automatically selected???
thanx in advance
-
fractalvibes
- Forum Contributor
- Posts: 335
- Joined: Thu Sep 26, 2002 6:14 pm
- Location: Waco, Texas
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
not yet, every time i think i'm ready to make the database one of the ones i;m working with decides there needs to be a new feild, so i then give them another day to figureout if we've missed something...result: i'm preparing the php for the db, but am holding off on making the db since some tables (specifically the main one) keeps getting modified
> i wanna enter the current date in datetimeformat when an entry is made, would that work right if i passed it NOW() as the value?
Thats one way. The other is to make your field a timestamp and it will automatically do that. A note, though, timestamp auto-updates EVERY time you edit the record, (I use it for last-updated type fields)
So if you want the date the record was entered, perhaps try setting the default in the field definition as NOW(). I am FAIRLY certain you can use a function as a default value and eliminate the need to bother with it in your code.
Been lazy, always will be lazy.
Thats one way. The other is to make your field a timestamp and it will automatically do that. A note, though, timestamp auto-updates EVERY time you edit the record, (I use it for last-updated type fields)
So if you want the date the record was entered, perhaps try setting the default in the field definition as NOW(). I am FAIRLY certain you can use a function as a default value and eliminate the need to bother with it in your code.
Been lazy, always will be lazy.
this is for comments. they wont be updateable. but that's good to know because i plan to make a forums later from scratch to accompany the profiles i'm making.
backstory: i keep gettng told i don't have the db/php experience needed to get jobs, a friend wants her own rateme site and is great with graphics. we're teaming up. we're deciding layout and functionality together, but she she doesn't even knwo html i'm doing ALL the coding and leaving ALL the graphics to her. so it'll show off db/php abilities. we're adding some features not on other rateme sites so that we can have a hook of being more than a simple rateme site...
backstory: i keep gettng told i don't have the db/php experience needed to get jobs, a friend wants her own rateme site and is great with graphics. we're teaming up. we're deciding layout and functionality together, but she she doesn't even knwo html i'm doing ALL the coding and leaving ALL the graphics to her. so it'll show off db/php abilities. we're adding some features not on other rateme sites so that we can have a hook of being more than a simple rateme site...
>backstory: i keep gettng told i don't have the db/php experience needed to get jobs
Whatever. I got my experience from jobs. I got them. I compensated for my lack of knowledge, and now I have the experience. Don't let peoples opinions dissuade you. They are probably just trying to limit the competition anyway.
Whatever. I got my experience from jobs. I got them. I compensated for my lack of knowledge, and now I have the experience. Don't let peoples opinions dissuade you. They are probably just trying to limit the competition anyway.