Page 1 of 1

Why am I getting user ID and not the info?

Posted: Wed Aug 06, 2003 2:55 pm
by DougieC
for example:
Address: 2
Fax#:2
Email:2

Code: Select all

<?php
$sql = "SELECT DISTINCT ag.AgencyID, ag.CompanyName, 
                                         ag.Address, ag.StateOrProvince, ag.City,
                                        ag.Phone, ag.Email, ag.Fax, ag.ContactName, 
                                         ag.TollFree, ag.WebSite, ar.Area, s.Services


             FROM Agencies ag

             INNER JOIN AgencyAreas aa ON (ag.AgencyID = aa.AgencyID)
             INNER JOIN Areas ar ON (aa.AreaServedID = ar.AreaServedID)

              INNER JOIN AgencyServices ags ON (ag.AgencyID = ags.AgencyID)
              INNER JOIN Services s ON (ags.ServiceID = s.ServiceID)

              INNER JOIN UserLogin ul ON (ag.AgencyID = ul.AgencyID)


              WHERE ul.UserName LIKE'".$username."'

              AND ul.Password LIKE '".$password."'";

$result= mysql_query($sql);

?>
thanks

Posted: Wed Aug 06, 2003 3:58 pm
by Stoker
do the query manually first, as simple as possible without joins, does that work? if so start adding the joins..