Web Design Forum: Php and mysql auto increment id - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Php and mysql auto increment id

#1 User is offline   wolf125 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 79
  • Joined: 12-May 11
  • Reputation: 0
  • Gender:Male
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 14 September 2011 - 07:34 PM

I made a php page that makes entries in a table, but i want to automatically assign ids that go up a number each time starting with one. Does anyone know enough php and/or mysql to help me?

I would appreciate any assistance.
0

#2 User is online   Renaissance-Design 

  • Available for custom WordPress work
  • Group: Moderators
  • Posts: 3,585
  • Joined: 12-August 10
  • Reputation: 558
  • Gender:Male
  • Location:South Wales
  • Experience:Web Guru
  • Area of Expertise:Designer/Coder

Posted 14 September 2011 - 07:42 PM

Set auto_increment for that field in mysql and pass that field an empty value on insert (if you're passing an array of named fields).

This post has been edited by Renaissance-Design: 14 September 2011 - 07:45 PM

0

#3 User is offline   wolf125 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 79
  • Joined: 12-May 11
  • Reputation: 0
  • Gender:Male
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 14 September 2011 - 07:52 PM

how do i do that. I dont really have any knowledge in editing features of mysql accept for messing with tables and such.

This post has been edited by wolf125: 14 September 2011 - 07:53 PM

0

#4 User is offline   wolf125 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 79
  • Joined: 12-May 11
  • Reputation: 0
  • Gender:Male
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 14 September 2011 - 07:56 PM

I also would like to know how to make the table show entries in order of id by default.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users