RE: me noob. link if else.. help.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First off, the line

echo "<a
href="$row_rsViewLinks['linksLink']"$row_rsViewLinks['linksName']</a>;"
needs to look more like

echo "<a
href=\"$row_rsViewLinks['linksLink']\"$row_rsViewLinks['linksName']</a>;"

or 
echo '
  <a href="' . $row_rsViewLinks['linksLink'] . '"' .
$row_rsViewLinks['linksName'] . '</a>
';

And you should use the NOT operator for the if statement:

if (! $row_rsViewLinks['linksLink']){
   echo $row_rsViewLinks['linksName'];
} else {
   echo '
	<a href="' . $row_rsViewLinks['linksLink'] . '"' .
$row_rsViewLinks['linksName'] . '</a>
   ';
}

> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux