Dear Monks, I would like to fetch data from a MySQL database. I read perlmonks tutorials and other sources but still I have some problems.
I have the following table structure holding words of a splitted text file:
|id |line_n |word |word_position
--------------------------------------------
|1 |1 |Lorem | 1
|2 |1 |ipsum | 2
|3 |1 |dolor | 3
|4 |1 |sit | 4
|5 |1 |amet, | 5
|6 |2 |consectetuer | 1
|7 |2 |adipiscing | 2
|8 |2 |elit. | 3
|9 |3 |Phasellus | 1
|10 |3 |non | 2
|11 |3 |erat | 3
|12 |3 |... | 4
By retrieving data from db I wold like that my output would be the same as follow:
line 1 Lorem ipsum dolor sit amet,
line 2 consectetuer adipiscing elit.
line 3 Phasellus non erat ...
That is the original layout of my text file.
Well, among different fetching methods I don't know exactly which one is the most useful for such a purpose. Moreover I don't know yet how to write a good code; but this is another problem.
thanks, Francesco
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.