NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page [PHP-SQL] Add a column with autoincrement data. Help!

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
6 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 09-24-2011, 12:14 PM THREAD STARTER               #1 (permalink)
Senior Member
 
Pichichi's Avatar
Join Date: Apr 2008
Posts: 1,022
Pichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to behold
 




[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
Pichichi is offline   Reply With Quote
Old 09-28-2011, 07:25 AM   #2 (permalink)
Domains my Dominion
 
sdsinc's Avatar
Join Date: Aug 2005
Location: Web 1.0
Posts: 9,963
sdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatness
 


Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer Animal Rescue Wildlife
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
sdsinc is offline   Reply With Quote
Old 09-28-2011, 12:04 PM THREAD STARTER               #3 (permalink)
Senior Member
 
Pichichi's Avatar
Join Date: Apr 2008
Posts: 1,022
Pichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to behold
 




thanks, i will take a look!
__________________

Free and Unlimited sitemap generator - Zitemaps.com
ResultadosDeportivos.net | PlanetaWebs.com
Pichichi is offline   Reply With Quote
Old 09-28-2011, 01:21 PM   #4 (permalink)
NamePros Regular
 
tiawood's Avatar
Join Date: Oct 2008
Location: Florida
Posts: 450
tiawood is a splendid one to beholdtiawood is a splendid one to beholdtiawood is a splendid one to beholdtiawood is a splendid one to beholdtiawood is a splendid one to beholdtiawood is a splendid one to beholdtiawood is a splendid one to beholdtiawood is a splendid one to behold
 




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:

tiawood is offline   Reply With Quote
Old 09-29-2011, 09:54 AM THREAD STARTER               #5 (permalink)
Senior Member
 
Pichichi's Avatar
Join Date: Apr 2008
Posts: 1,022
Pichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to beholdPichichi is a splendid one to behold
 




thanks for the explanation tiawood
__________________

Free and Unlimited sitemap generator - Zitemaps.com
ResultadosDeportivos.net | PlanetaWebs.com
Pichichi is offline   Reply With Quote
Reply


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

 
All times are GMT -7. The time now is 02:49 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger