Filter by <%=(sUser)%>

Results 1 to 2 of 2

Thread: Filter by <%=(sUser)%>

  1. #1
    Join Date
    Dec 1969

    Default Filter by <%=(sUser)%>

    basically what i am trying to do it filter my SQL on my ASP by the users login name... my SQL statment currently looks like this...<BR><BR>SELECT newsID, title, summary, key_article, the_date, startdate, expiry_date, info, doc, image, contact, keywords, hide, dept_id, doc_typeID, deptId<BR>FROM dbo.newsDB<BR>WHERE contact = &#039;MMColParam&#039; AND expiry_date between getdate() and dateadd(day, 30, getdate())<BR><BR><BR><BR>By the way the varible name MMColParam and the runtime value at the moment is: Session("MM_username") <BR><BR>The session varible does not work as the user does not login at tge first stage.. ideally i would like to use their &#060;%=(sUser)%&#062; (login username) <BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Filter by <%=(sUser)%>

    im trying to understand what you are doing with that script but i cannot seem to grasp the concept...<BR><BR>your code(written my way to read easier)<BR>select * from table_name where contact = session and date(30th day)<BR><BR>i honestly dont know why you are trying to select a db value with where date clause is.<BR><BR>oh god..i just realised your using dreamweaver....good luck in trying to fix those codes :)<BR><BR><BR><BR>a session is created for each user after they have logged in by the server - how else will the server know to put a session to an individual person if they dont log in? unless you put a session on everyone, but that will let everyone on in, if that makes sesnse...- secondly - and this is only what i think, and should not be used as a decision for your own thought, but dreamweaver is great for HTML pages, but not for doing javascript or server side scripting.<BR><BR><BR>if your looking for a log-on script i can give you one.

Posting Permissions

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