sequel problem

Discussion in 'Databases' started by gilgalbiblewheel, May 12, 2006.

  1. #1
    I don't even have 1 in the field. I don't know why it's reading 1.

    Heres' what I have:
            <td colspan="1" align="center">
                <%
                'This SQL statement creates a list of books
    [COLOR=Red]            SQL1 = "Select title, chapter FROM scarletandthebeast WHERE title = '" & title & "'"[/COLOR]
    '& " ORDER BY Chapter ASC"
    
                response.write sql1 & "</br>"
    rs.Open sql1,conn, 1
                    %>
                    <select name="title" id="title" size="5" style="width:500;" onchange="go('refresh');" <%'onchange="go2();"%>>
                    <%
                    Do until RS.eof
                        %>
                        <option <%if title = rs("title") then response.write "selected" end if%> value="<%=RS("title")%>"><%=RS("title")%></option>
                        
                        <%
                        rs.movenext
                        if rs.eof then
                            exit do
                        end if
                    Loop
                    %>
                    </select>
                    <%
                rs.close
                
                %>
            </td>
    Code (markup):
    And it's reading:
    [COLOR=Red]Select title, chapter FROM scarletandthebeast WHERE title = '1'[/COLOR]
    Code (markup):
    THis is what it should read instead of 1:

     
    gilgalbiblewheel, May 12, 2006 IP
  2. anjanesh

    anjanesh Well-Known Member

    Messages:
    344
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    165
    #2
    Whats the value of title when you have a response.write title before your SQL1 =... line ?
     
    anjanesh, May 14, 2006 IP
  3. gilgalbiblewheel

    gilgalbiblewheel Well-Known Member

    Messages:
    435
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #3
    I made some changes. There was a function on reading numbers (I was using a recycled code). I added numbers in the field. I understand the sql now.
     
    gilgalbiblewheel, May 14, 2006 IP