Jump to content

Php - Select & Update Statement To Return And Update A Multi Dimensional Array


Wildhalf

Recommended Posts

I Have asked on stack overflow but im not getting a good answer so decided to come here.

 

I am a learn as you go php programmer.... but think i am a bit out data by the looks of things any way if you look at the following question it will show you what i am trying to do

 

http://stackoverflow.com/questions/13238787/php-select-update-statement-to-return-and-update-a-multi-dimensional-array

 

&

 

http://stackoverflow.com/questions/13117872/php-rotate-and-adding-to-an-array

 

thanks in advance to anyone who can help

Link to comment
Share on other sites

Even after reading both the stack overflow threads, I haven't the foggiest idea what it is you're after.  Perhaps if you better explain your end goal and why exactly you want to do what you are trying to do someone could better understand what you want and offer help.

 

Link to comment
Share on other sites

Kicken, Sorry for being so confusing.

 

Basically i am building a rotator script.

 

Here is how my database looks:

 

rotator.png

 

both id & fb_user_id are unique for every entry.

 

What i am doing is building a kind of affiliate system with signup page with a form. I am rotating the sponsors link on the page so they are in order related to who joined first. When someone gets a signup they are put on the end of the rotation again untill they have say 2 signups.

 

So when a new user signs up via the rotator page the order goes from

 

fb_user_id - oder

1 - 1

2 - 2

3 - 3

 

to this

 

fb_user_id - oder

1 - 4

2 - 1

3 - 2

4 - 3

 

so the new member goes in 3rd in line and the person who referred them goes in right behind them in 4th unless that had been there 2nd signup in this case they will no longer be in the rotation.

 

Do you have any more questions?? Hope this makes it a bit clearer

Link to comment
Share on other sites

Are you simply trying to rotate the array?

You marked your first link in SO as solved. The second link seems like a similar problem so i'm not exactly sure what the specific issue is.

 

Are you trying to rotate the array you get when you retrieve the 'order' column?

Link to comment
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.