PDA

View Full Version : mysql and asp - only show 1 record


Baleric
10-23-2006, 07:59 AM
hey guys,
when i call a field from my mysql database i can only call the field out once,

lets say i call out txtusername from the database i can only display it once on the page,
i cant display the same record 2 times on the same page,
anyone know whats going on?

is there a setting in mysql or sumthing?

help most appreciated.


cheers

baleric

Brandoe85
10-23-2006, 10:06 AM
I don't know what you mean, really?

Put it in a variable?
Dim var

' in some recordset loop
var = rs("field").Value

Is that what you mean?

Baleric
10-23-2006, 10:50 AM
lets say i make a recordset, if i do this on the page

recordset("ID") <br>
recordset("ID")

only the first one shows up, the second duplicate will now show up,
its really weird..

and its happening on my home pc aswell as my laptop

coudl it be im using longtext in the database?
should i use just text?

Baleric
10-23-2006, 11:05 AM
it works when i use tiny text :), how many characters can tiny text hold?,
and what is the best field type to use? the data will be between 2 and 500 characters,

any help appreciated,

cheers

baleric

guelphdad
10-23-2006, 11:28 AM
there is something wrong with your code so how about you show us the while loop you are using to output your results?

you can show the same row an infinite number of times should you do so. everything in your where clause would be done before the next row is shown.

Baleric
10-24-2006, 12:53 AM
<%@ Language="VBScript" %>
<% Option Explicit %>
<html>
<head>
<title>Issue</title>
</head>
<body>
<%
Dim Connection, Recordset
Dim sSQL, sConnString, mm_con_string
mm_con_string = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=testdata;USER=root;PASSWORD=root;OPTION=3;"
sSQL="SELECT * FROM uDetail"
sConnString = MM_CON_STRING
Set connection = Server.CreateObject("ADODB.Connection")
Set recordset = Server.CreateObject("ADODB.Recordset")
connection.Open sConnString
recordset.Open sSQL,connection
%>

<% = recordset("temail") %>
<% = recordset("temail") %>

<%
Recordset.Close
Connection.Close
Set Recordset = Nothing
Set Connection = Nothing
%>
</body>
</html>

thats the cleaned up version of the code im using,
without all the tables and div class's etc.

im using the code on an update details page where the user has to type there email in 2 times to confirm, and i want the email to show up straight away in the textfield so if they dont touch the email its automatically the same,

it is only showing up in 1 field, same as the password field,
but when i change the field from longtext to tinytext, it shows up as many times as i like.

any other suggestions?