Re: Problems with INNER JOIN

From: Date: Thu, 29 Jan 2009 21:42:01 +0000
Subject: Re: Problems with INNER JOIN
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-45914@lists.php.net to get a copy of this message
Terion Miller wrote:
Hi Everyone! I am having problems getting an INNER JOIN to work and need some tips trouble shooting where the problem may be. What I'm trying to do is match up AdminID's from two tables and display only that users orders, sounds simple enough right...but I can't get it to return the AdminID... My Query: $sql =
     "SELECT admin.AdminID , workorders.AdminID
         FROM admin
             INNER JOIN
         workorders ON
          (admin.AdminID=workorders.AdminID)
         WHERE admin.UserName =   '".$_SESSION['user']."' ";
      $result = mysql_query ($sql);
      $row = mysql_fetch_assoc ($result);
      $Total = ceil(mysql_num_rows($result)/$PerPage);
Thanks for any tips on how else I can accomplish this...
I explained all of this here: http://marc.info/?l=php-general&m=123318173022009&w=2 and here: http://marc.info/?l=php-general&m=123318438826250&w=2 Which part didn't make sense? -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#45914) next »