Silly SQL question

Results 1 to 6 of 6

Thread: Silly SQL question

  1. #1

    Default Silly SQL question

    Hey guys,<BR>I havent coded in a number of months and dont have my reference material with me, so hopefully you can assist with this question.<BR><BR>Im trying to catch a particular value from the database from a request.querystring value "memberID"<BR><BR>When moving to the full details page...I might receive something like this as a value<BR><BR>memberID=Andrea%20Potter<BR><BR>Which is fine, however im storing my firstname and lastname values in seperate fields.<BR><BR>EG. <BR>member_firstname = Andrea<BR>member_lastname = Potter<BR><BR>Whats the best way to identify the querystring value and select the correct value from the database?<BR><BR>Sorry, Im a little rusty!<BR><BR>Thanks,<BR>John<BR>

  2. #2
    Join Date
    Dec 1969

    Default Has little to do with SQL

    &#060;%<BR>memID = Replace( Request("MemberID"), "&#039;", "&#039;&#039;" ) &#039; might as well do this here<BR>temp = Split( MemID, " " ) &#039; %20 is just an encoded space<BR>If UBound(temp) = 0 Then<BR> ... only one name entered...what do you want to do about that? ...<BR><BR>Else<BR> fname = temp(0)<BR> lname = temp( UBound(temp) ) &#039; in case they entered first middle last<BR> SQL = "SELECT * FROM members " _<BR> & WHERE member_firstname = &#039;" & fname & "&#039; AND member_lastname = &#039;" & lname & "&#039;"<BR> Set RS = yourAlreadyOpenConnection.Execute( SQL )<BR> If RS.EOF Then<BR> ... no such person in members table...<BR> ... what will you do about it? ...<BR> Else<BR> Response.Write "Welcome back, " & fname <BR> ...<BR> End If<BR>End If<BR>%&#062;<BR>

  3. #3

    Default Thanks Bill

    I havent coded in months...I cant beleive how quickly you lose this knowledge!<BR><BR>John

  4. #4

    Default one more dopey question...

    Using hyperlinks such as A B C D E F G H I J ....etc<BR><BR>How can I display members that last names begin with "F" when they click on F<BR><BR>I deserve a slap I know...<BR><BR>John

  5. #5
    Join Date
    Dec 1969

    Default RE: one more dopey question...

    "SELECT columns FROM tableNamne WHERE lastName LIKE &#039;"+Request.Querystring("letter").item+"%&#039 ;"

  6. #6

    Default WAHOO!! <eop>


Posting Permissions

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