Web Hosting Talk







View Full Version : how to randomize the data


hairos
05-17-2004, 06:12 AM
I have a MySQL database, with some fields:
userID, name, email, Approved

I need to show a random data when Approved 'y'.

here's my code :
<%
call OpenConn
call OpenRs(RsContent,"select UserID,Name,Email, from MSUser where lower(UserID)='" & lcase(session("UserID")) & "' and upper(approved) = 'Y' order by rand() limit 1"
call GetRowsRs(RsContent,DataContent,DataContentRow)
call CloseRs(RsContent)
call CloseConn
%>

But it didn't work.

Maybe you guys can help me ?

Burhan
05-17-2004, 08:00 AM
What errors are you getting? Have you printed the query before sending it to make sure its printing correctly?

Are you sure you are connected to the server properly?

hairos
05-17-2004, 09:51 PM
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'OpenConn'

astraeuz
05-18-2004, 02:10 AM
It means you're trying to call the function 'OpenConn' but nothing is defined as 'OpenConn'.

hairos
05-18-2004, 06:08 AM
ignore it, I already solved my problem.

Thanks for replying.