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


In reply to Extracting Numerous records by Ombongi.Moraa

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.