Hi Monks

Suppose there is a table like this in the mysql database

Employee_Information containing columns like this

id name age salary

1 A 30 10000

2 B 32 12000

- - - -

so on...

I want to write a CGI program with using DBI and HTML template so that my program will fetch all the data (It may be 1 row or more than 1 row)from the Employee_Information and show me in the browser like this
<code>
id (text field containg value 1)

name (text field containg value A)

age (text field containg value 30)

salary (text field containg value 10000)

id (text field containg value 2)

name (text field containg value B)

age (text field containg value 32)

salary (text field containg value 12000)

-----so on.Show all the rows present in the database

From the browser i can modify the values and update it in the database. Also i can add a new row contains all fields with their respective values from the browser to the database and i can delete any row by selecting it from browser from the database.

Can anyone suggest me a suitable code for it.

Regd's
Sanjay

In reply to How to write a CGI program to fetch data from mysql database and show in the browser with values in the text field? by sanjay nayak

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.