Προς το περιεχόμενο

lathos kodikas


georgeuk

Προτεινόμενες αναρτήσεις

Δημοσ.

paidia prospatho na kataskeyaso mia basi kai exo problima. to mysql den dexetai to parapano kodika kai mu bgazeis sfalma.

 

CREATE TABLE Pet (

petID INT(5) SERIAL,

petName CHAR(25) NOT NULL,

petType CHAR(15) NOT NULL DEFAULT “Misc”,

petDescription VARCHAR(255),

price DECIMAL(9,2),

pix CHAR(15) NOT NULL DEFAULT “na.gif”,

PRIMARY KEY(petID) );

 

apo biblio to exo parei to paradeigma

 

mu bgazei pos exo error sto syntax tis sql

Δημοσ.

Πρωτα απο ολα πρεπει να κανεις την αρχει με διμιουργια νταταμπασε και το κριειτε ταμπλε θελει ερωτηματικο

Δημοσ.

loipon san kwdikas den exei la8i

to mono simeio pou me problimatizei einai to SERIAL :confused:

 

elpizw episis na min einai to na.gif pou bgazei to problima...:???:

 

pantws apo apopsi erwtimatikwn kai tetoia ola kala einai !!!

 

sigoura omws prwta apola prepei na dimiourgiseis mia database !

Δημοσ.

Βεβαιώσου πως η βάση δεδομένων που χρησιμοποιείς είναι η ίδια έκδοση με αυτή του βιβλίου... Και δοκίμασε χωρίς την λέξη serial.

Δημοσ.

dulepse xoris to serial telika. mipos einai aparaitito omos? giati deite ti leei gia to serial:

 

The CREATE query defines the petID column as SERIAL (added in

MySQL 4.1). SERIAL is a keyword that defines the column in the following

ways:

• BIGINT: The data in the field is expected to be a numeric integer,

with a range up to 18446744073709551615. The database wonʼt

accept a character string in this field.

• UNSIGNED: The integer in the field canʼt be a negative number.

• NOT NULL: This definition means that this field canʼt be empty. It

must have a value. The primary key must always be NOT NULL.

• AUTO-INCREMENT: This definition means that the field will automatically

be filled with a sequential number if you donʼt provide

a specific number. For example, if a row is added with 98 for a

petID, the next row will be added with 99 for the petID unless

you specify a different number. This is a useful way of specifying a

column with a unique number, such as a product number or an

order number. You can always override the automatic sequence

number with a number of your own, but if you donʼt provide a

number, a sequential number is stored

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...