|Problems? Is your data what you think it is?|
Extracting Numerous recordsby Ombongi.Moraa (Novice)
|on Jan 27, 2014 at 10:47 UTC||Need Help??|
Ombongi.Moraa has asked for the
wisdom of the Perl Monks concerning the following question:
1 XXXX A B C
2 AAAA A B C
3 YYYY A B C
4 XXXX A B C
5 XXXX A B C
6 YYYY A B C
My MySQL table will take the above structure; The query the user sends is counterchecked against values in the 2nd column. At times, like the case of identities XXXX and YYYY, there are multiple rows for the identity; All my responses (a response is a merger of cols. 3, 4..) must fit into 160-characters (sms) so only one row can be sent as a reply at a time; However, since there are multiple records of that identity, the user will want to receive all this info.
When the user sends first request with “XXXX”, the first time, I send out a response telling them 3 records were found for that user. They should reply with anything within e.g. 5 minutes, to get the next record.
2nd request (<5mins after 1st request), I send them row1 info; 3rd request, I send back row4 info ... timestamp between two subsequent requests must be at most 5 minutes – I end up creating some kind of a sms session. > 5 mins , “session expires”, they must start all over again.
Please advise on the best way to process request and extract the next record if a request comes in within a session. I hope what I'm trying to achieve has been explained clearly