problem with getting info from 2 tables in PHP / MySQL
- From: Neal <pissed@xxxxxxxxxxx>
- Date: Tue, 02 Aug 2005 17:58:46 GMT
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....} .
- Follow-Ups:
- Re: problem with getting info from 2 tables in PHP / MySQL
- From: utque
- Re: problem with getting info from 2 tables in PHP / MySQL
- From: utque
- Re: problem with getting info from 2 tables in PHP / MySQL
- From: utque
- Re: problem with getting info from 2 tables in PHP / MySQL
- From: utque
- Re: problem with getting info from 2 tables in PHP / MySQL
- From: utque
- Re: problem with getting info from 2 tables in PHP / MySQL
- From: utque
- Re: problem with getting info from 2 tables in PHP / MySQL
- From: Sergej Andrejev
- Re: problem with getting info from 2 tables in PHP / MySQL
- From: JDS
- Re: problem with getting info from 2 tables in PHP / MySQL
- Prev by Date: Re: turn off register_globals on a shared server
- Next by Date: Re: mail() fails - php4, sendmail, suse
- Previous by thread: Loading MySQL from Access
- Next by thread: Re: problem with getting info from 2 tables in PHP / MySQL
- Index(es):
Relevant Pages
|