problem with getting info from 2 tables in PHP / MySQL
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

problem with getting info from 2 tables in PHP / MySQL

From: Neal <pissed@comcast.net>
Date: Tue Aug 02 2005 - 19:58:46 CEST

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....

}
Received on Mon Oct 24 02:09:09 2005