i have 2 different table named productlist and rsales
the ff data in productlist are
id|pcode|
1 |1220 |
and the ff data in rsales are
id|total|total_discount|
3 |500 | 50 |
my problem is that i want to select data from two different table which is productlist and rsales and display it horizontally. i tried everything but it display vertically. the result must be something like this
id|pcode|total|total_discount|
1 |1220 |500 | 50 |
this is my code so far but it only display data from single table
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("inventory", $con);
$result = mysql_query("SELECT * FROM productlist");
while($row = mysql_fetch_array($result))
{
echo '<tr>';
echo '<td>'.$row['pcode'].'</td>';
echo '</tr>';
}
mysql_close($con);
?>