SELECT MAX(id) FROM

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sirTemplar
Forum Commoner
Posts: 65
Joined: Wed Dec 18, 2002 1:57 am

SELECT MAX(id) FROM

Post by sirTemplar »

how do i do this. i want

$new_id =

the result of this query

$query = "SELECT MAX(id) FROM mytable";

+ 1


thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

  1. perform the query
  2. fetch the resultant column
  3. add one.
sirTemplar
Forum Commoner
Posts: 65
Joined: Wed Dec 18, 2002 1:57 am

Post by sirTemplar »

thanks.
Post Reply