Re: Making a Variable from different tables with Matching Dbfields?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Well I tried both ways and still cannot get it to pick up the AdminID,

$query "SELECT admin.AdminID , workorders.AdminID FROM admin INNER JOIN workorders on AdminID WHERE admin.UserName = 'tmiller' "
$result	""
$row	""
$SortBy	"WorkOrderID DESC"
$Page	"1"
$PerPage	"30"
$StartPage	"0"
$sql "SELECT admin.AdminID , workorders.AdminID FROM admin INNER JOIN workorders ON AdminID(admin, workorders) WHERE admin.UserName = 'tmiller' "
$Total	"0"

That is not the right syntax still.

It needs to be:

select
 admin.AdminID, workorers.AdminID
from
 admin inner join workorders using (AdminID)
WHERE
 admin.userName='tmiller';


or


select
 admin.AdminID, workorers.AdminID
from
 admin inner join workorders ON (admin.AdminID=workorders.AdminID)
WHERE
 admin.userName='tmiller';

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux