lundi 4 juillet 2016

join three table in php


I have three table mainaccount, admitcard,result. mainaccount has 40 columns. I want to join all three column. So I can fetch easly all data from table by one query. I have a code. Is it true. Can any one check please. Because code is not running.

require"connection.php";
$result=mysql_query("select mainaccount.*,admitcard.*,result.* from mainaccount,
                    admitcard,
                    result 
                    where mainaccount.email=admitcard.email 
                    AND admitcard.email=result.email 
                    AND mainaccount.email=result.email 
                    AND mainaccount.email='$username'");
while($row=mysql_fetch_array($result))
{
    extract($row);
    if(mainaccount.payment=='done' && mainaccount.formfill=='done')
    {   
          echo"hello";
    }

Aucun commentaire:

Enregistrer un commentaire