4 example:
table structure:
CREATE TABLE word (
word_id int(11) NOT NULL auto_increment,
data1 VARCHAR( 255 ) NOT NULL,
data2 VARCHAR( 255 ) NOT NULL
,PRIMARY KEY (word_id)) ;
<?
$hostname="***";
$user="***";
$pass="****";
$dbase="***";
$connection=mysql_connect("$hostname","$user","$pass");
$db=mysql_select_db($dbase,$connection);
print "<table border=\"1\">
<tr> ";
print "<td>First Data</td>";
print "<td>Match</td>";
print "<td>Not Match</td>";
print "</tr>";
include("connect.php");
$sql_command="SELECT * FROM word";
$result=mysql_query("$sql_command");
while( $row = mysql_fetch_object( $result))
{
print "<tr>";
if ($row->data1==$row->data2)
{
print "<td>$row->data1</td>";
print "<td>$row->data2</td>";
print "<td> </td>";
}
else
{
print "<td>$row->data1</td>";
print "<td> </td>";
print "<td>$row->data2</td>";
}
print "</tr>";
}
print "</table>";
?>
</body>
</html>