Jump to content

Recommended Posts

I think what your asking to do is swap the position two records are stored in the actual database, what you will have to do is extract the values of each field from both the records and then update each record with the other records values, excluding the primary key field.  This will then have the effect of swapping them around, I think!
Link to comment
https://forums.phpfreaks.com/topic/26952-phpmysql-question/#findComment-123248
Share on other sites

[quote author=chiprivers link=topic=114659.msg466593#msg466593 date=1163276806]
I think what your asking to do is swap the position two records are stored in the actual database, what you will have to do is extract the values of each field from both the records and then update each record with the other records values, excluding the primary key field.  This will then have the effect of swapping them around, I think!
[/quote]
That's what i thought, thanks freind  ;)
Link to comment
https://forums.phpfreaks.com/topic/26952-phpmysql-question/#findComment-123251
Share on other sites

well i might be wrong .. but you could always set up and id field w/ auto increment and then set up the code to change the # of the id field from say 5 to 2 but then you would have to change the id field of 2 to 5 .. im sure it would be hard to setup .. but you might be able to create some type of counter that would decrease and increase the field number at the same time .. that kind of thing .. but i could be wrong .. :] but as chiprivers said you might not be able to do it with the primary key ...
Link to comment
https://forums.phpfreaks.com/topic/26952-phpmysql-question/#findComment-123262
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.