SELECT company.c_id AS a, company.cname AS b, companytype.ctname AS c, company.caddress AS d, worktime.woname As e, location.loname As f, company.zipcode AS g, company.phone AS h,company.fax AS i
FROM (company INNER JOIN worktime ON company.c_id = worktime.worktimeid)
INNER JOIN location ON company.c_id = location.locationid INNER JOIN companytype ON company.c_id = companytype.ctypeid;";
echo $sql;
$db_query=mysql_db_query($db,$sql);
$result=mysql_fetch_array($db_query);
$c_id=$result[a];
$cname=$result;
$caddress=$result[c];
$zipcode=$result[d];
$ctname=$result[e];
$woname=$result[f];
$loname=$result[g];
$phone=$result[h];
$fax=$result[i];