problem with getting info from 2 tables in PHP / MySQL



I've got 2 tables. One, I manually insert data into for HTTP authentication. It has 3 fields: username, password, school. Once the user enters the corrrect u and p, the school name shows up hard coded into a form that gets submitted into another table. So, there is a 'school' field in both tables that always match. Now, I want to draw all the info from this second table to print out but am having problems. So far, I've got something like:

$sql = mysql_query("SELECT * FROM logintable, datatable WHERE logintable.school = datatable.school");
while($row = mysql_fetch_array($sql)){


print("$row[school], $row[field1], etc....

}
.



Relevant Pages

  • Re: HOTMAIL ACCOUNT HACKED
    ... or she logged into her e-mail account from a terminal at school ... which had some type of keystroke logging ..." ... logged in under her username, went to Hotmail, saw they got in without a ...
    (microsoft.public.security)
  • Re: problem with getting info from 2 tables in PHP / MySQL
    ... This part works and all the info gets put into a table called 'jobs'. ... I'm trying to make another page where they can login and only their school will show up. ... I put that echo part just to test if I get the correct school according to the username and password. ...
    (comp.lang.php)
  • Re: problem with getting info from 2 tables in PHP / MySQL
    ... Recently I had a cource in university about DBMS and I think you should ... TABLE login(user_id, username, password, school_id) ... Now you can login by selecting user from login table like this ... To limit your select to one school try ...
    (comp.lang.php)
  • Re: OT - Anyone here use SBC DSL with Free Agent?
    ... SCHOOL!) ... and to keep from having to enter my username and password all ... I added a ".newsauth" file to my home directory containing my ...
    (rec.roller-coaster)