| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Apr 2008
Posts: 1,022
![]() ![]() ![]() ![]() ![]() ![]() ![]() | [PHP-SQL] Add a column with autoincrement data. Help! Hello i am trying to make a thing that looks easy but it is taking me a lot of time and i am not sure how to make it... I want to add a column in a sql database wich have to be filled from 1 to ... X. Is it possible to make it when adding the column? The database is already created but i want to modify it to match with a project i have and i need a column with that index. I've tried to make it throught php also, making a insert instruction for every record but it doesnt works... Does anyone know how to make it easyly? MANY THANKS in advance
__________________ Free and Unlimited sitemap generator - Zitemaps.com ResultadosDeportivos.net | PlanetaWebs.com |
| | |
| | #2 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,963
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Well it's a called an identity column if I understand correctly ![]() http://dev.mysql.com/doc/refman/5.0/...increment.html
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| | |
| | THREAD STARTER #3 (permalink) |
| Senior Member Join Date: Apr 2008
Posts: 1,022
![]() ![]() ![]() ![]() ![]() ![]() ![]() | thanks, i will take a look!
__________________ Free and Unlimited sitemap generator - Zitemaps.com ResultadosDeportivos.net | PlanetaWebs.com |
| | |
| | #4 (permalink) |
| NamePros Regular Join Date: Oct 2008 Location: Florida
Posts: 450
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | You have to make that value (name it something such as id) auto increment, set it up as the key(primary) and it has to be an integer. Do this through the mysql or PHPMyAdmin. Then when you insert via PHP, you actually wouldn't specify the id as the database will do that for you. See the highlighted areas below:
__________________ ██ 6 Website HotSpots You May Have Missed | Custom Web Development & Graphic Deals ██ |
| | |
| | THREAD STARTER #5 (permalink) |
| Senior Member Join Date: Apr 2008
Posts: 1,022
![]() ![]() ![]() ![]() ![]() ![]() ![]() | thanks for the explanation tiawood
__________________ Free and Unlimited sitemap generator - Zitemaps.com ResultadosDeportivos.net | PlanetaWebs.com |
| | |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Add Headlines > Add Templates > Domain Hack Forums > Fabrcs ---> .com's Quick Sales! | getchaname | Domains For Sale - Fixed Price | 0 | 09-13-2011 10:27 AM |
| Domainate Weekly 6/9: SeniorsGroups(.)com, MigraineRemedies(.)org + 28, < $130 each | Domainate.com | Domains For Sale - Fixed Price | 1 | 06-13-2011 11:40 AM |