DMXzone Server Connect Support Product Page

field values in an array

Asked 27 Oct 2016 14:10:51
1
has this question
27 Oct 2016 14:10:51 Hans Haverlach posted:
Is it possible to get the field value from one field of all the records produced by an server action file into an array?

Replies

Replied 27 Oct 2016 14:16:39
27 Oct 2016 14:16:39 Teodor Kuduschiev replied:
Hi Hans,

Can you please explain what exactly needs to be achieved (with an example if possible) ?
Replied 27 Oct 2016 15:39:49
27 Oct 2016 15:39:49 Hans Haverlach replied:
OK I will try:
On opening a page, the visitor is added to a waiting list. This is a database table with the visitors ID and some extra info. A CRON script in the background checks this table every minute and picks the top one waiting client and changes it's status to active. When this client is active, it redirect that client to a different page.

Because there are more visitors, the waiting list table can hold 10 or more records.
There is an action scheduler on the page that fires an action file that queries the waiting list table.:
1. to see who has status of active. -> redirect that person to different page
2. to get a up-to-date list with waiting clients (status: waiting).

I want to put the waiting client's ID's in an array, so I can write a script to find out what the waitings position is of the client who is on that page. But maybe there is an easy/different way to achieve this?
Replied 28 Oct 2016 07:48:42
28 Oct 2016 07:48:42 Teodor Kuduschiev replied:
Okay so the waiting clients come from a query, right?
Do you want to simply print something like this on your page:


QuoteID123 - Waiting Position 1
ID456 - Waiting Position 2
ID789 - Waiting Position 3
....
ID999 - Waiting Position 99


Replied 28 Oct 2016 09:27:42
28 Oct 2016 09:27:42 Hans Haverlach replied:
Yes, almost. I only want the client see it's own position in the waiting list, like:

Your waiting positon is 4. There are 3 clients waiting before you.

Reply to this topic