how to join the tables?
Posted: Sat Feb 04, 2006 9:26 pm
how can i apply join query in the following code? as i want to display all records from the table. Currently i am getting records from the table but with reptition. I have 2 records but 8 records are retrieving with repitition of previous.
Code: Select all
include "conn.php";
echo "<table border=1>";
$sql="select * from data, proj_analysis, ser_req";
$result=mysql_query($sql,$conn) or die (mysql_error());
while ($row=mysql_fetch_array($result))
{
$id=$row['c_id'];
$uname=$row['name'];
$pdesc=$row['p_desc'];
$deadline=$row['deadline'];
$budget=$row['exp_budget'];
$fwb=$row['FWB'];
$res=$row['REs'];
$wm=$row['WM'];
$sd=$row['SD'];
$gd=$row['GD'];
$dd=$row['3D'];
$fp=$row['FP'];
$ew=$row['EW'];
$sc=$row['SC'];
$opi=$row['OPI'];
$est=$row['EST'];
$aai=$row['AAI'];
$ddw=$row['DDw'];
$no=$row['c_number'];
$email_id=$row['email'];
echo " <tr>
<td width=\"171\">Customer ID : </td>
<td width=\"182\">$id </td>
</tr>
<tr>
<td>Name : </td>
<td>$uname </td>
</tr>
<tr>
<td>Phone Number : </td>
<td>$no </td>
</tr>
<tr>
<td>E-mail Address : </td>
<td>$email_id </td>
</tr>
<tr>
<td>Product Description : </td>
<td>$pdesc </td>
</tr>
<tr>
<td>Deadline : </td>
<td>$deadline </td>
</tr>
<tr>
<td>Budget : </td>
<td>$budget </td>
</tr>
<tr>
<td>Services Required : </td>
<td>$fwb <br> $res <br> $wm <br> $sd <br> $gd <br> $dd <br> $fp <br> $ew <br> $sc <br> $opi <br> $est <br> $aai <br> $ddw <br></td>
</tr>";
}
echo "</table>";