in DB i have two tables named my one and two.in table one there is a colum named by name and in table two there is colum named by address. when i run the query it show the result but the problem with this is that it show same result two times. can any one pleaze help me out.
in database table is like that
name address
ali1 hyderabad
hyder1 karachi
<?
$cn=mysql_connect("localhost","root");
mysql_select_db("test",$cn);
// Make a MySQL Connection
// Construct our join query
$query = "SELECT one.name,two.address FROM one,two";
$result = mysql_query($query) or die(mysql_error());
echo " name "."address";
echo "<br />";
while ($row=mysql_fetch_array($result)){
echo $row['name']. " - ".$row['address'];
echo "<br />";
}
?>
result
name address
ali1 - hyderabad
hyder1 - hyderabad
ali1 - karachi
hyder1 - karachi