0

hello my project is web discussion forum i want to show topics or articles title in table and make it hyperlink .

i want get data from database table and display in html table how its poossible...?

4
Contributors
7
Replies
13
Views
5 Years
Discussion Span
Last Post by JorgeM
1

Yes it's possible. You would build the table elements as you run through the results of your query.

Alternatively, if you use Visual Studio, you easily incorporate controls such as a Gridview (which renders as an HTML table).

0

yes i use visual stdio but i can't use gridview.
i use html table how can i get data from database and show in table.

0

You would build the table elements as you run through the results of your query.

As JorgeM has pointed out, you would build your TD/TR etc as you step through your loop.

Start and end your table outside of the loop:

<table>
<?php
    WHILE LOOP/IF LOOPDO WHILE LOOP
?>
</table> 
0

In the code behind as you read from the data source, you have to add the tr an td elements so that your output becomes a combination of HTML elements and data.

0

There are several examples online. Each using different methods. Here are some that I found:

http://www.w3schools.com/aspnet/showasp.asp?filename=demo_table2
http://msdn.microsoft.com/en-us/library/0e39s2ck(v=vs.80).aspx
http://msdn.microsoft.com/en-us/library/7bewx260.aspx

unfortunately, its going to be challenging to give you exactly the code you need. It all depends on what else is happening within the project.

This should at least give you enough to get an understanding. What you need to do is connect to the database and build the table and fill in the information as you read from the DB.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.