SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help in SQL Query..

    Hi,

    Is there a way to view a data in database that is equal to my session name

    Code PHP:
     
    if(mssql_num_rows(mssql_query("Select * from tblAssign where AssignTo='$_SESSION[username]'"))>0){
    	echo "not viewing my assig ticket";
    	 while($pendticket = mssql_fetch_array($selectTicketsQuery)){
            $pendtickets[] = $pendticket;
    		}
    	}else{
        $selectTicketsQuery = mssql_query("Select * from tblTicket inner join tblAssign on tblTicket.TickNo=tblAssign.TicketNo where tblTicket.Status='Open'");
    	 while($pendticket = mssql_fetch_array($selectTicketsQuery)){
            $pendtickets[] = $pendticket;
    		}

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,401
    Mentioned
    147 Post(s)
    Tagged
    4 Thread(s)
    If the IF is true, you try to loop through $selectTicketsQuery, but you never assigned a query result set to that variable.

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah..that's what i figure out..it solved the my problem.


Bookmarks

Posting Permissions

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