Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 09:54 AM
Stefan Vorster
Guest
 
Posts: n/a
Default Please Help Out .. Db Problim

Ok i have a table in a database that looks like this

Id , user , Time
1 test 200312341
2 test 324234234
3 userna 232837872

But i just wanne show on the page

test
userna

How can i do that
  #2  
Old July 19th, 2005, 09:55 AM
Ray at
Guest
 
Posts: n/a
Default Re: Please Help Out .. Db Problim

select distinct [user] from theTable

Ray at home

"Stefan Vorster" <doggy@webmail.co.za> wrote in message
news:01a401c3b96c$bcaa26a0$a001280a@phx.gbl...[color=blue]
> Ok i have a table in a database that looks like this
>
> Id , user , Time
> 1 test 200312341
> 2 test 324234234
> 3 userna 232837872
>
> But i just wanne show on the page
>
> test
> userna
>
> How can i do that[/color]


  #3  
Old July 19th, 2005, 09:55 AM
Bhaskardeep Khaund
Guest
 
Posts: n/a
Default Re: Please Help Out .. Db Problim

Hi,

Paste this code into a new asp file. Set you Database Connection(objConn) and put your table names.

<html>
<head><title></title></head>
<body>
<table width="80%" align="center">
<%
Dim id, objRs
id = Trim(Request.Form("id"))
sql = "select * from table_name "
Set objRs = Server.CreateObject("ADODB.Recordset")
objRs.Open sql, objConn
while not objrs.EOF
%>
<tr>
<td><%=objRs("id")%></td>
<td><%=objRs("user")%></td>
<td><%=objRs("time")%></td>
</tr>
<%objrs.MoveNext
Wend
%>
</table>
</body>
</html>
<%Set objRs = Nothing %>
  #4  
Old July 19th, 2005, 09:55 AM
Jeff Cochran
Guest
 
Posts: n/a
Default Re: Please Help Out .. Db Problim

On Tue, 2 Dec 2003 23:11:56 -0800, "Stefan Vorster"
<doggy@webmail.co.za> wrote:
[color=blue]
>Ok i have a table in a database that looks like this
>
>Id , user , Time
>1 test 200312341
>2 test 324234234
>3 userna 232837872
>
>But i just wanne show on the page
>
>test
>userna
>
>How can i do that[/color]

How are you currently showing everything? Either just select the User
column in your SQL query, or when your query returns everything, just
display the user column.

SELECT user FROM table
{Display the whole record set using GetString()}

- or -

SELECT * FROM table
{Display only the User field in a loop}

I prefer the former, you might look at:

http://www.aspfaq.com/show.asp?id=2467

Jeff
 

Bookmarks

Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles