Précédent   Forum des professionnels en informatique > Bases de données > MySQL > Débuter
Débuter Forum d'entraide pour débuter avec MySQL
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 01/03/2008, 18h05   #1
Membre habitué
 
Inscription : août 2004
Messages : 451
Détails du profil
Informations forums :
Inscription : août 2004
Messages : 451
Points : 137
Points : 137
Envoyer un message via MSN à artotal
Par défaut création de table

Bonjour,
j'essaie de créer une table en suivant scrupuleusement un livre
mais j'ai une erreur sur le type float, mais je ne comprend pas pourquoi ?
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
requête SQL:
CREATE TABLE bt_produits(
prd_id mediumint( 8 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
date_entree date NOT NULL DEFAULT '0000-00-00',
reference varchar( 20 ) NOT NULL DEFAULT '',
id_fourn mediumint( 8 ) UNSIGNED NOT NULL DEFAULT '0',
ref_fourn varchar( 30 ) DEFAULT NULL ,
prix_ht float( 10.2 ) UNSIGNED NOT NULL DEFAULT '0.00',
prix_ttc float( 10.2 ) UNSIGNED NOT NULL DEFAULT '0.00',
prix_promo float( 10.2 ) UNSIGNED NOT NULL DEFAULT '0.00',
stock mediumint( 8 ) UNSIGNED NOT NULL DEFAULT '0',
stock_mini mediumint( 8 ) UNSIGNED NOT NULL DEFAULT '0',
delai varchar( 150 ) DEFAULT NULL ,
poids mediumint( 8 ) UNSIGNED NOT NULL DEFAULT '0',
taux_tva tinyint( 3 ) UNSIGNED NOT NULL DEFAULT '1',
actif tinyint( 3 ) UNSIGNED NOT NULL DEFAULT '1',
ventes mediumint( 8 ) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY ( prd_id ) ,
KEY date_entree( date_entree ) ,
KEY actif( actif ) ,
KEY ventes( ventes )
)
 
MySQL a répondu:Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '10.2) unsigned NOT NULL default '0.00',
             prix_ttc float(10.2) UNSIGNED NOT N' at line 7
Merci
__________________
contribution sur phpclasses d'une classe de connection à une base de donnée en php5
http://www.phpclasses.org/browse/file/23687.html
artotal est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/03/2008, 18h56   #2
Membre expérimenté
 
Inscription : août 2005
Messages : 515
Détails du profil
Informations forums :
Inscription : août 2005
Messages : 515
Points : 557
Points : 557
Bonjour,
peut-être parce que la syntaxe correcte est FLOAT(10,2).

Cordialement,
DaRiaN.
DaRiaN est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/03/2008, 19h25   #3
Membre habitué
 
Inscription : août 2004
Messages : 451
Détails du profil
Informations forums :
Inscription : août 2004
Messages : 451
Points : 137
Points : 137
Envoyer un message via MSN à artotal
merci
l'habitude de la syntaxe anglo-saxonne
__________________
contribution sur phpclasses d'une classe de connection à une base de donnée en php5
http://www.phpclasses.org/browse/file/23687.html
artotal est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 08h02.


 
 
 
 
Partenaires

Hébergement Web