I looked at your page.  First off, you should add a primary key column that
has no information in it.  Just make this a number(4) called state_id. 
Then you will be able to specify that it's auto_increment.  The problem you
had is that you tried to make a varchar column auto_increment which makes no
sense.  Auto_increment will start at 1 and each time you insert a new row
will assign a unique key = max(state_id)+1

Also any number columns should be number types.  You can apply formatting
(commas separating 100's) when you select the data or present it with php.

As for your other issues, I can't see what the error message was, but when
you are using number types like smallint, you shouldn't specify lengths..
these are implicit in the type.  A smallint for example is 2 bytes. This
means that you have 64k of possible integers that can be stored in there.
What you do want to make sure is that it's unsigned.


-----Original Message-----
From: Freedomware [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 23, 2004 6:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How do you set up table columns for numerals?

I'm having some roblems creating a table with phpMyAdmin. I think 
they're pretty minor problems, mostly relating to numerals.

Would someone be willing to look at my notes at 
http://geowebworks.geobop.org/mysql/3.php - especially the last picture 
- and suggest what I need to do to fix it?

It's also possible the instructions I'm following are flawed, though 
they look pretty sensible. Here's the last error message I got:

#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 '(20), `Area` VARCHAR(6), `Area` SMALLINT(8), `HighestAltitude`

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to