Why am I getting user ID and not the info?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
DougieC
Forum Newbie
Posts: 18
Joined: Fri Jul 25, 2003 1:49 pm

Why am I getting user ID and not the info?

Post 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
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

do the query manually first, as simple as possible without joins, does that work? if so start adding the joins..
Post Reply