• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

the problem that i can't slove (asp)

suhailkaleem

New Member
i am having some problem and this problem is making my project more and more complicated as i procede please help
i am using ultradev 4

my db table looks like this



Table name= user_info


id | name | email | rate1 | rate2 | rate3 | rate4 | rate5|Url
----|------|---------|--------|-------|-------|-------|------|-------------------------------
1 |karen |Me@S.com | 1 | | 3 | 2 | 5 |http://someserver.com/mypic.jpg
2 |me |u@s.com | | 1 | | | |http://someserver.com/yourpic.jpg
3 |u |b@s.com | 4 | | 3 | 1 | |http://myserver.com/coolpic.jpg




ok on the main page i make a rs of the above table (user_info) and then add a dynamic image in the page from the
url coloum , now i made five radio buttons - when click on the button it will submit the value of the radio button which is 1 in this case
now when everi selected the radiou button labled rate 1 rate 2 raet 3 it makes a new row in the db - what i want is that it do not make a new row but it add the
rating to the excisting coloum from which the image is coming from.if the image-url is coming from the karen record(see above table) then it should add the rating to
that row (1+1=2 or 2+5=8) it should not make a new row but when i try it makes a new row that i do not want


secondly i want to out put the rating of specific user for example in above table i want to show the total rating by adding all coloums rate1+rate2+rate3+rate4+rate5 and % of karen url
i want to out put that as a line graph like 1 people rate her rate1, 0 people rate her rate2, 3 people rate her rate 3 and so on.. all that in graph .
that is all i want - i tried my best to explain what i am messing with.please help - i want to do that in ud4 with almost no hand coding -if i should use hand coding then
please provide me with the code

sorry for bad english.

thank you and waiting for a helpfull reply .

suhailkaleem
 
no i am using update -

i want to rate the random pic which is comming froma access db and store every pic rating in there respective coloum

that i cant do

any help ???
 
ok here it is what i am trying to do but no luck.
the scripts take values from the cloum and display the % and total votes of every image -- but it is not displying for every image it is only displaying for the first image in the db -- look at the script and tell me what is wrong.




<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/ruhot.asp" -->
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = ruhot
Recordset1.Source = "SELECT * FROM user_info"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>


<%
dim Total_votes
dim Percent
Total_Votes = Recordset1("pic_rate1").Value + Recordset1("pic_rate2").Value + Recordset1("pic_rate3").Value+ Recordset1("pic_rate4").Value+ Recordset1("pic_rate5").Value+ Recordset1("pic_rate6").Value+ Recordset1("pic_rate7").Value+ Recordset1("pic_rate8").Value+ Recordset1("pic_rate9").Value+ Recordset1("pic_rate10").Value







%>
<%
Response.write "Total "
Response.write " "
Response.Write ""& Recordset1("pic_rate1").Value & ""
Response.write " "
Response.write "People Rated you"
Response.Write " "
Response.Write " 1 "
Response.write "<br>"
%>
<%

Percent = FormatNumber((Recordset1("pic_rate1").Value)/(Total_votes)*100,1)

%>
<b> <font color="#FF0000">
<%
Response.Write (Percent)
response.write "%"
%>
</font> </b> <img src="vote.gif" width="<%=percent%>" height="5">
<%
Response.write "<br>"
%>
<%
Response.write "Total "
Response.write " "
Response.Write ""& objRS("pic_rate2").Value & ""
Response.write " "
Response.write "People Rated you"
Response.Write " "
Response.Write " 2 "
Response.write "<br>"
%>
<%

Percent = FormatNumber((objRS("pic_rate2").Value)/(Total_votes)*100,1)

%>
<b> <font color="#FF0000">
<%
Response.Write (Percent)
response.write "%"
%>
</font> </b> <img src="vote.gif" width="<%=percent%>" height="5">
<%
Response.write "<br>"
%>
<%
Response.write "Total "
Response.write " "
Response.Write ""& objRS("pic_rate3").Value & ""
Response.write " "
Response.write "People Rated you"
Response.Write " "
Response.Write " 3 "
Response.write "<br>"
%>
<%

Percent = FormatNumber((objRS("pic_rate3").Value)/(Total_votes)*100,1)

%>
<b> <font color="#FF0000">
<%
Response.Write (Percent)
response.write "%"
%>
</font> </b> <img src="vote.gif" width="<%=percent%>" height="5">
<%
Response.write "<br>"
%>
<%
Response.write "Total "
Response.write " "
Response.Write ""& objRS("pic_rate4").Value & ""
Response.write " "
Response.write "People Rated you"
Response.Write " "
Response.Write " 4 "
Response.write "<br>"
%>
<%

Percent = FormatNumber((objRS("pic_rate4").Value)/(Total_votes)*100,1)

%>
<b> <font color="#FF0000">
<%
Response.Write (Percent)
response.write "%"
%>
</font> </b> <img src="vote.gif" width="<%=percent%>" height="5">
<%
Response.write "<br>"
%>
<%
Response.write "Total "
Response.write " "
Response.Write ""& objRS("pic_rate5").Value & ""
Response.write " "
Response.write "People Rated you"
Response.Write " "
Response.Write " 5 "
Response.write "<br>"
%>
<%

Percent = FormatNumber((objRS("pic_rate5").Value)/(Total_votes)*100,1)

%>
<b> <font color="#FF0000">
<%
Response.Write (Percent)
response.write "%"
%>
</font> </b> <img src="vote.gif" width="<%=percent%>" height="5">
<%
Response.write "<br>"
%>
<%
Response.write "Total "
Response.write " "
Response.Write ""& objRS("pic_rate6").Value & ""
Response.write " "
Response.write "People Rated you"
Response.Write " "
Response.Write " 6 "
Response.write "<br>"
%>
<%

Percent = FormatNumber((objRS("pic_rate6").Value)/(Total_votes)*100,1)

%>
<b> <font color="#FF0000">
<%
Response.Write (Percent)
response.write "%"
%>
</font> </b> <img src="vote.gif" width="<%=percent%>" height="5">
<%
Response.write "<br>"
%>
<%
Response.write "Total "
Response.write " "
Response.Write ""& objRS("pic_rate7").Value & ""
Response.write " "
Response.write "People Rated you"
Response.Write " "
Response.Write " 7 "
Response.write "<br>"
%>
<%

Percent = FormatNumber((objRS("pic_rate7").Value)/(Total_votes)*100,1)

%>
<b> <font color="#FF0000">
<%
Response.Write (Percent)
response.write "%"
%>
</font> </b> <img src="vote.gif" width="<%=percent%>" height="5">
<%
Response.write "<br>"
%>
<%
Response.write "Total "
Response.write " "
Response.Write ""& objRS("pic_rate8").Value & ""
Response.write " "
Response.write "People Rated you"
Response.Write " "
Response.Write " 8 "
Response.write "<br>"
%>
<%

Percent = FormatNumber((objRS("pic_rate8").Value)/(Total_votes)*100,1)

%>
<b> <font color="#FF0000">
<%
Response.Write (Percent)
response.write "%"
%>
</font> </b> <img src="vote.gif" width="<%=percent%>" height="5">
<%
Response.write "<br>"
%>
<%
Response.write "Total "
Response.write " "
Response.Write ""& objRS("pic_rate9").Value & ""
Response.write " "
Response.write "People Rated you"
Response.Write " "
Response.Write " 9 "
Response.write "<br>"
%>
<%

Percent = FormatNumber((objRS("pic_rate9").Value)/(Total_votes)*100,1)

%>
<b> <font color="#FF0000">
<%
Response.Write (Percent)
response.write "%"
%>
</font> </b> <img src="vote.gif" width="<%=percent%>" height="5">
<%
Response.write "<br>"
%>
<%
Response.write "Total "
Response.write " "
Response.Write ""& objRS("pic_rate10").Value & ""
Response.write " "
Response.write "People Rated you"
Response.Write " "
Response.Write " 10 "
Response.write "<br>"
%>
<b> <font color="#FF0000">
<%
Response.Write (Percent)
response.write "%"
%>
</font> </b>
<%

Percent = FormatNumber((objRS("pic_rate10").Value)/(Total_votes)*100,1)

%>
<b> </b><img src="vote.gif" width="<%=percent%>" height="5">
<b> </b>
<%


Response.write "<br>"
Response.Write "Total votes"
Response.Write " "
%>
<b> <font color="#FF0000">
<%
Response.Write (Total_Votes)
%>
</font></b>
<%
objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing

%>
<%
Recordset1.Close()
%>


so u get it ?
 
use Recordset1 not objRS and it'll work

hmm....

glad php just has echo not response.write :D

you should clean this up

try reducing the number of response.writes some just add spaces that will get ingnored
 
Code:
<% 

Percent = FormatNumber((objRS("pic_rate3").Value)/(Total_votes)*100,1) 

%> 
<b> <font color="#FF0000"> 
<% 
Response.Write (Percent) 
response.write "%" 
%> 
</font> </b> <img src="vote.gif" width="<%=percent%>" height="5"> 
<% 
Response.write "<br>" 
%> 
<% 
Response.write "Total " 
Response.write " " 
Response.Write ""& objRS("pic_rate4").Value & "" 
Response.write " " 
Response.write "People Rated you" 
Response.Write " " 
Response.Write " 4 " 
Response.write "<br>" 
%>

becomes

Code:
<% Percent = FormatNumber((Recordset1("pic_rate4").Value)/(Total_votes)*100,1) %> 
<b><font color="#FF0000">
<%=Percent%>
%</font></b><img src="vote.gif" width="
<%=Percent%>
" height="5"><br>Total 
<%=Recordset1("pic_rate4").Value %>
 People Rated you 4<br>

stick it in a for loop and you loose 90% of your code :)
 
Originally posted by lucifer
use Recordset1 not objRS and it'll work

hmm....

glad php just has echo not response.write :D

you should clean this up

try reducing the number of response.writes some just add spaces that will get ingnored
 
Back
Top