0

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>";

}
}

1
Contributor
1
Reply
2
Views
9 Years
Discussion Span
Last Post by lydia21
0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.