array not matching db value?

Results 1 to 2 of 2

Thread: array not matching db value?

  1. #1
    Join Date
    Dec 1969

    Default array not matching db value?

    I am trying to grab some id&#039;s being passed by a form (creating an array) and then loop through them and compare them to values in my database ("id"). If they match I want to display another column value in the current record ("name"). <BR>My problem is that 1. my array is dropping the first value, it always displays one less and 2. when I try to display the corresponding "name" in the database, it&#039;s the wrong record. <BR><BR>Dim rsProperty, RefNumber, strSQL, iItem, MyArray <BR><BR>MyArray = split(Request.Form("CheckRef"), ",")&#039; id of checkboxes <BR> <BR>Set rsProperty = dbProperty.Execute("SELECT * FROM properties ORDER BY id") <BR> <BR>Do While Not rsProperty.EOF <BR> <BR>For iItem = 0 to ubound(MyArray) <BR> <BR>If iItem = rsProperty("id") Then <BR>%&#062; <BR>&#060;td class="medium" width="130" height="9" align="left" valign="top"&#062;&#060;%=(rsProperty.Fields("name ").Value)%&#062;&#060;/td&#062;&#060;% <BR><BR>End If <BR> <BR>Next <BR>rsProperty.MoveNext <BR>Loop <BR> <BR>rsProperty.Close <BR>Set rsProperty = Nothing <BR>dbProperty.Close <BR>Set dbProperty = Nothing <BR>

  2. #2
    Join Date
    Dec 1969

    Default Don't repost...

    ...without saying you are doing so.<BR><BR>I just answered this in your original thread.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts