ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 24th, 2003, 10:23 AM
zahidpervaiz zahidpervaiz is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 5 zahidpervaiz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question How can we show record from data base in tables (3) column

Hello,
How r u? I have one difficulty.I want to show records in
3 column from data base.
how can i do this.?
actually i want to show records in row and column.
but want to show records on conditions.

when i run this code it show all records in one column.
i want to show records in three(3) column
<!--#INCLUDE file="connection.asp" -->
<%

dim sql
%>
<HTML>
<HEAD><TITLE>Welcome...</TITLE>
</HEAD>
<BODY>

<table border="0" align=left>

<%
rs.Open "select * from accesseries",cn
dim a,b,c,d,e,f
while not rs.EOF
a = rs.Fields ("companyname").Value
b = rs.Fields ("PBox").Value
c = rs.Fields ("telno").Value
d = rs.Fields ("faxno").Value
e = rs.Fields ("email").Value
f = rs.Fields ("email").Value

%>
<tr>
<td><h3><font color="#FFCC33">
<%response.Write (a)%></font></h3></td></tr>
<tr><td><font color="black"><h4><b>
<%=b%>
</b></h4></font></td></tr>
<tr><td><font color="black">
<%="P.O.Box: "%><%=c%>
</font></td></tr>
<tr><td><font color="black">
<%="Phone: "%><%=d%>
</font></td></tr>
<tr><td><font color="black">
<%="Fax: "%><%=e%>
</font></td></tr>
<tr><td><font color="black">
<%="E mail: "%><%=f%>
</font></td></tr>

<%rs.MoveNext
wend
%>
</table>

</BODY></HTML>

Reply With Quote
  #2  
Old August 24th, 2003, 07:54 PM
rdoekes rdoekes is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Strasbourg, France
Posts: 181 rdoekes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 8
Send a message via AIM to rdoekes Send a message via Yahoo to rdoekes
You have defined your html table as one cell rows:

Try this instead:
Code:
<% While Not rs.EOF%>
<tr><td><% = a%></td>
<td><% = b%></td>
etc....
<td><% = f%></td></tr>
<% rs.MoveNext
 Wend%>

This will make the one row per record.

Hope this helps
__________________
- Rogier Doekes

Reply With Quote
  #3  
Old August 24th, 2003, 09:52 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 9 m 52 sec
Reputation Power: 10
Send a message via ICQ to stumpy Send a message via MSN to stumpy
"<td>...</td>" defines a cell
"<tr>...</tr>" defines a row

e.g. a three columned row would look like this (with correct formatting):
Code:
<tr>
  <td>...</td>
  <td>...</td>
  <td>...</td>
</tr>
... repeat

Reply With Quote
  #4  
Old August 25th, 2003, 01:55 AM
zahidpervaiz zahidpervaiz is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 5 zahidpervaiz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question how can i show database records in multipl column.?

Dear,You can't understand my Question I want to show records
in ist row just 4 records.5th records must show in 2nd column.
as it is 4 records in 2nd column.and 9th record must show in 3rd
column. and so on..........
Please help me in this matter.

Reply With Quote
  #5  
Old August 25th, 2003, 11:45 AM
rdoekes rdoekes is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Strasbourg, France
Posts: 181 rdoekes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 8
Send a message via AIM to rdoekes Send a message via Yahoo to rdoekes
The way HTML tables are built is row by row. What you are asking is to first build 4 rows in one column and then move on to the next columns. I believe you can do this with nesting tables and a row counter.
Code:
<table>
<tr "valign="top">
  <td>
<% intcounter = 1
While Not rs.EOF
  If intCounter MOD 4 = 1 Then %>
    <table>
<% end if%>
        <tr valign="top">
           <td><% = a%></td>
           <td><% = b%></td> etc...
        </tr>
<% if IntCounter MOD 4 = 0 Then%>
    </table>
     </td>
     <td>
<% end if
      rs.MoveNext
      intCounter = intCounter + 1
  Wend
   If IntCounter MOD 4 <> 1 Then
%>
      </table>
<% End If%>
   </td>
 </tr>
</table>


You might have to tweak this a little bit, I have not tested this. Play around with the MOD 4 = xx a little bit to get you the desired results.

Hope this helps

Reply With Quote
  #6  
Old August 26th, 2003, 06:15 AM
zahidpervaiz zahidpervaiz is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 5 zahidpervaiz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up BUNDLE OF THANKS

Bundle of thanks friend,
i have tried it now it is working perfectly.
thanks again.
TAKE CARE.
bye.
ZAHID.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > How can we show record from data base in tables (3) column


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek