hi
i want to check the uname from the database and the session variable...
please tell how to write if condition
<?
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");

echo "<table width='60%'>";
$result=mysql_query("SELECT jobid,jobtitle,cname,uname FROM please");

print "<tr><td>jobtitle </td>
<td>cname</td></tr>";
if ($result[3] == $_SESSION[uname])
{
for ($i = 0; $i < mysql_num_rows($result); ++$i)
{

$line = mysql_fetch_row($result);
print "<tr><td><a href='welcome.php?jobid=".$line[0]."'>".$line[1]."</td><td>".$line[2]."</td></tr>";
print "<tr><td></td><td></td></tr>";

}
}

$result=mysql_query("SELECT jobid,jobtitle,cname FROM please where uname='$_SESSION[uname]'");
thanks i got it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.