Home > Archive > PHP SQL > August 2004 > Problem creating a table in PHPmyadmin
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problem creating a table in PHPmyadmin
|
|
| Perfidus 2004-08-18, 3:57 pm |
| I'm trying to create a table from phpmyadmin, the table is created
but it stumbles when trying to ad the first
--------
CREATE TABLE leche2 ( Id INT , Campo2 VARCHAR(255) ,
Campo3 INT , Campo4 VARCHAR(255) , Campo5 DOUBLE ,
Campo6 INT , Campo7 VARCHAR(50) , Campo8 DOUBLE ,
Campo9 DOUBLE , Campo18 DOUBLE , Campo17 DOUBLE , Campo16
VARCHAR(50) , Campo15 INT , Campo14 VARCHAR(50)
, Campo13 VARCHAR(50) , Campo12 VARCHAR(50) , Campo11
INT , Campo10 VARCHAR(255),KEY Id(Id) );
INSERT INTO leche2 VALUES (
10001,"FONDO PESCADOR EXTRA",40000105,"leches de galicia
S.L.",2,64,15,"RED",1000,8,11,85,0,"U1C8",1,"PF","M","C",60111001,"FONDOS
DE GRUPO"
);
--------
The error message:
--------
consulta SQL :
INSERT INTO leche2
VALUES (
10001, "FONDO PESCADOR EXTRA", 40000105, "ARROCERIAS DE
ALICANTE S.L.", 2, 64, 15, "RED", 1000, 8, 11, 85, 0,
"U1C8", 1, "PF", "M", "C", 60111001,
"FONDOS DE GRUPO TAPELIA"
)
MySQL ha dicho:
Column count doesn't match value count at row 1
--------
Any hints??
----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
http://www.phpfreaks.com
http://www.phpfreaks.com/forums
| |
| mushroom 2004-08-18, 3:57 pm |
| I belive each of your values (even the numbers) should be inclosed in
single not double quotes.
----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
http://www.phpfreaks.com
http://www.phpfreaks.com/forums
| |
|
|
|
| "Perfidus" wrote:
> I’m trying to create a table from phpmyadmin, the table is
> created
> but it stumbles when trying to ad the first
>
> --------
> CREATE TABLE leche2 ( Id INT , Campo2 VARCHAR(255) ,
> Campo3 INT , Campo4 VARCHAR(255) , Campo5 DOUBLE ,
> Campo6 INT , Campo7 VARCHAR(50) , Campo8 DOUBLE ,
> Campo9 DOUBLE , Campo18 DOUBLE , Campo17 DOUBLE , Campo16
> VARCHAR(50) , Campo15 INT , Campo14 VARCHAR(50)
> , Campo13 VARCHAR(50) , Campo12 VARCHAR(50) , Campo11
> INT , Campo10 VARCHAR(255),KEY Id(Id) );
>
>
> INSERT INTO leche2 VALUES (
> 10001,"FONDO PESCADOR EXTRA",40000105,"leches de galicia
>
S.L.",2,64,15,"RED",1000,8,11,85,0,"U1C8",1,"PF","M","C",60
111
> 001,"FONDOS
> DE GRUPO"
> );
> --------
>
> The error message:
>
> --------
> consulta SQL :
>
> INSERT INTO leche2
> VALUES (
>
> 10001, "FONDO PESCADOR EXTRA", 40000105, "ARROCERIAS DE
> ALICANTE S.L.", 2, 64, 15, "RED", 1000, 8, 11, 85, 0,
> "U1C8", 1, "PF", "M", "C", 60111001,
> "FONDOS DE GRUPO TAPELIA"
> )
>
> MySQL ha dicho:
>
>
> Column count doesn’t match value count at row 1
> --------
>
> Any hints??
>
>
>
> ----------------------------------------
> The post originated from PHP Freaks:
> ----------------------------------------
> http://www.phpfreaks.com
> http://www.phpfreaks.com/forums
I think mysql is getting about what columns are accepting
what values.
It is ALWAYS better to do:
insert into tablename (cola, colb, colc) values (’xx’, ’yy’, ’zz’)
Also note that for your auto-increment field, you don’t need to input
any value, although it would accept it if you push a value in there
that is unique.
I suggest that you do an insert with phpmyadmin itself. Then look at
the sql command that is generated.
--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-SQL-Pro...pict140920.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=471681
|
|
|
|
|