1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP member function getrows problem

Discussion in 'PHP' started by MrPJH, Mar 12, 2012.

  1. #1
    Any Help fixing this error

    
     $query3 = "SELECT * from hidden WHERE USERID = '".mysql_real_escape_string($_SESSION['USERID'])."'";
    
     	$executequery3 = $conn->Execute($query3);
    
    	$hidden = $executequery3->getrows();   
    
    $query2 = "SELECT A.*, B.seo, C.*, D.PID from Table1 A, Table2 B, Table3 C, hidden D where A.active='1' AND A.category=B.CATID AND A.USERID=C.USERID AND D.PID!=$hidden.PID order by A.feat desc, limit $pagingstart, $config[items_per_page]";
    
    
    PHP:
    Here is the error LOG details
     PHP Fatal error:  Call to a member function getrows() on a non-object in /home/user/public_html/domain/file.php on line ...[where above code is stated]
    
    Code (markup):

    i want this as

    
    $query2 = "SELECT A.*, B.seo, C.*, D.PID from Table1 A, Table2 B, Table3 C, hidden D where A.active='1' AND A.category=B.CATID AND A.USERID=C.USERID AND D.PID!=A.PID order by A.feat desc, $dby limit $pagingstart, $config[items_per_page]";
    
    PHP:
    the part
    D.PID!=A.PID
    PHP:
    works for every one even user loged in or not or this data is related to logedin user or anyone else
    and i want it as
    select D.PID from Row where "_$Session userid"=USERID
    PHP:
     
    Last edited: Mar 12, 2012
    MrPJH, Mar 12, 2012 IP
  2. MrPJH

    MrPJH Well-Known Member

    Messages:
    1,066
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    155
    #2
    Well not sure what happened
     $query3 = "SELECT PID from hidden_new WHERE USERID = '".mysql_real_escape_string($_SESSION['USERID'])."'";
    
     	$executequery3 = $conn->Execute($query3);
    
    	$hidden_new = $executequery3->fields['PID'];  
    PHP:
    $query2 = "SELECT A.*, B.seo, C.* from Table1 A, categories B, members C where A.active='1' AND A.category=B.CATID AND A.USERID=C.USERID AND A.PID!='$hidden_new' order ..";
    
    PHP:
    called query3 results here in query2 as
    AND A.PID!='$hidden_new'
    PHP:
    above code worked for me but i am still confused
    i used same above code for my old table "HIDDEN" but it gave the same error

    later i created a new table "hidden_new" and problem fixed

     
    MrPJH, Mar 12, 2012 IP