Raised This Month: $ Target: $400
 0% 

Mysql update AUTO_INCREMENT id.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bcKq
Member
Join Date: Dec 2012
Location: Tczew, Poland
Old 11-05-2013 , 16:05   Re: Mysql update AUTO_INCREMENT id.
Reply With Quote #1

First you have to do
PHP Code:
SELECT id FROM table_name WHERE 1=1 ORDER BY id DESC LIMIT 0,
this will give u the max id (latest player added), get that id from that query,
PHP Code:
id++ 
then
PHP Code:
UPDATE 'blabla' SET id='%d' (and here you place new id
This will update and the player's ID will be the newest entry added
(don't know exact queries that you want to make but you get the idea, use the first one, then id = id+1 and update)
__________________
This is my signature.
bcKq is offline
Old 11-05-2013, 16:20
w2zzaaa
This message has been deleted by w2zzaaa.
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode