php - Multiple mysql tables with where ... AND -


can somehow compare 3 tables this?

i error:

mysql_free_result() expects parameter 1 resource

$duom=mysql_query("select * pazymiai, mokinys, mokymo_dalykas pazymiai.mokinio_nr = mokinys.nr , pazymiai.dalyko_nr = mokymo_dalykas.nr;");     while ($result = mysql_fetch_array ($duom)) {         echo("             <tr>             <td>$result[6]</td>             ...             </tr>");     }     mysql_free_result($duom);     mysql_close(); 

here sql using join. work?

select * pazymiai p join mokinys m on p.mokinio_nr = m.nr join mokymo_dalykas md on p.dalyko_nr = md.nr 

documentation link: http://dev.mysql.com/doc/refman/5.0/en/join.html


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -