Problems with null

Results 1 to 3 of 3

Thread: Problems with null

  1. #1
    Join Date
    Dec 1969

    Default Problems with null

    I have a db in which when the user registers it only puts in values for the username, email, and password, the other 9 fields are left blank(no values added). There&#039s no problem doing that, but then there&#039s the page where the user can update their details. This page in turn goes to a script which compares the old details against the new info, if anything changes, it updates accordingly. Only problem is that when it runs across one of those null values in the comparison, it throws it all off.<BR><BR>You&#039ll see the check to see if the value is null, and then change it to "", but that refuses to work.<BR><BR>&#039COMPARE VALUES, SEE IF ANYTHING CHANGED, AND ADD TO NEW QUERY PARTS IF NECESSARY<BR>for slot = 0 to 9<BR> if (arrUserCurrent(slot, 0) = null) then<BR> arrUserCurrent(slot, 0) = ""<BR> end if<BR> <BR> if cstr(arrUserUpdate(slot, 1)) &#060;&#062; cstr(arrUserCurrent(slot, 0)) then<BR> userUpdateData = userUpdateData & ", " & arrUserUpdate(slot, 0) & "=&#039" & arrUserUpdate(slot, 1) & "&#039"<BR> addSlot = addSlot + 1<BR> end if<BR>next

  2. #2
    Join Date
    Dec 1969

    Default RE: Problems with null

    Try this...<BR><BR>if (isnull (arrUserUpdate (slot, 0)) or cstr(arrUserUpdate(slot, 1)) &#060;&#062; cstr(arrUserCurrent(slot, 0))) then<BR><BR>Then you can get rid of the conversion altogether.

  3. #3
    Steve Cimino Guest

    Default RE: Problems with null

    Try:<BR><BR>if ISNULL(arrUserCurrent(slot, 0)) then<BR><BR>OR<BR><BR>a favorite in this forum, which does really well:<BR><BR>If Len(arrUser) &#062; 0 Then<BR> &#039Has a value

Posting Permissions

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