Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 31st, 2005, 6:44 PM   #1
Intimidat0r
Hobbyist Programmer
 
Intimidat0r's Avatar
 
Join Date: May 2005
Location: Don't know, but the padded walls are a nice touch.
Posts: 126
Rep Power: 0 Intimidat0r is an unknown quantity at this point
Send a message via ICQ to Intimidat0r Send a message via AIM to Intimidat0r Send a message via MSN to Intimidat0r Send a message via Yahoo to Intimidat0r
mySQL query file

if i have a file like hello.sql and this code in it:

CREATE TABLE hello (
     somevar int(10) NOT NULL,
     somevar2 varchar(11) NOT NULL,
     valid_until datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
     somevar3 varchar(11) NOT NULL,
     somevar4 int(10) NOT NULL
);

then what's up with the valid_until datetime line? im tryting to manually do everything instructed here using phpMyAdmin because my commercial server im using doesn't let you execute query files like this so how would i do that line in phpMyAdmin? (or at least, what the hell does it mean)
__________________
Children in the dark cause accidents, and accidents in the dark cause children.

http://www.ronincoders.org
Intimidat0r is offline   Reply With Quote
Old Jul 31st, 2005, 8:45 PM   #2
skuinders
Hobbyist Programmer
 
skuinders's Avatar
 
Join Date: Jun 2005
Location: MA, US
Posts: 204
Rep Power: 4 skuinders is on a distinguished road
Without researching to make sure I'm 100% correct:

valid_until = field name

datetime = field value type (Google: SQL datetime, for more info)

DEFAULT '0000-00-00 00:00:00' = sets the default value for this field to '0000-00-00 00:00:00' if one isn't supplied (this might also serve to establish the format of the date/time, I'm not sure).

NOT NULL = this field cannot be NULL for any record
__________________
"A stupid man's report of what a clever man says can never be accurate, because he unconciously translates what he hears into something he can understand."
- B. Russell

http://web.bryant.edu/~srk2
skuinders is offline   Reply With Quote
Old Aug 1st, 2005, 12:46 PM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
CREATE TABLE hello (
somevar int(10) NOT NULL,
somevar2 varchar(11) NOT NULL,
valid_until datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
somevar3 varchar(11) NOT NULL,
somevar4 int(10) NOT NULL
);
Open phpMyAdmin, log in.
Select a database
Fill in the Create New Table fields (table name and number of fields), click Go.
(This puts up a form for defining the table, see attached image 1.)
Fill out the table per your specifications, see attached image 2.
Click Save.
Attached Images
File Type: jpg Image1.jpg (15.7 KB, 17 views)
File Type: jpg Image2.jpg (15.4 KB, 18 views)
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Aug 1st, 2005, 5:47 PM   #4
Intimidat0r
Hobbyist Programmer
 
Intimidat0r's Avatar
 
Join Date: May 2005
Location: Don't know, but the padded walls are a nice touch.
Posts: 126
Rep Power: 0 Intimidat0r is an unknown quantity at this point
Send a message via ICQ to Intimidat0r Send a message via AIM to Intimidat0r Send a message via MSN to Intimidat0r Send a message via Yahoo to Intimidat0r
ah, okay thanks for your help :-)
__________________
Children in the dark cause accidents, and accidents in the dark cause children.

http://www.ronincoders.org
Intimidat0r is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:02 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC