![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
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 |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: MA, US
Posts: 204
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#3 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
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.
__________________
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 |
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
ah, okay thanks for your help :-)
__________________
Children in the dark cause accidents, and accidents in the dark cause children. http://www.ronincoders.org |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|