Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6870775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:43:29+00:00 2026-05-27T03:43:29+00:00

<?php if(isset($row[‘link’]) && !empty($row[‘link’])) { echo ‘<td><a href=’.$row[‘link’].’ target=_self\>Link name</a></td>’; } ?> using this

  • 0
<?php
    if(isset($row['link']) && !empty($row['link']))
    {
        echo '<td><a href="'.$row['link'].'" target="_self\">Link name</a></td>';
    }
?>

using this code removes the text Link name as well from the table, but i prefer to keep the text but unlinked when [‘link’] has empty value

any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:43:30+00:00Added an answer on May 27, 2026 at 3:43 am
    <?php
        {
            echo '<td>';
            if(isset($row['link']) && !empty($row['link']))
                echo '<a href="'.$row['link'].'" target="_self\">';
            echo 'Link name';
            if(isset($row['link']) && !empty($row['link']))
                echo '</a>';
            echo '</td>';
        }
    ?>
    

    This logic will allow you to do much more than just output the name. Naturally, if all you need is outputting the name, then the cleaner way would be

    down vote

    if(isset($row['link']) && !empty($row['link']))
    {
        echo '<td><a href="'.$row['link'].'" target="_self\">Link name</a></td>';
    } else {
        echo '<td>Link name</td>';
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Take this code: <?php if (isset($_POST['action']) && !empty($_POST['action'])) { $action = $_POST['action']; } if
while ($row = mysql_fetch_row($result)) { echo <tr>; echo (<p><td>$row[2]</td><td>$row[0]</td><td>$row[1]</td><td><i>$row[3]</i></td><td><a href=\delete.php?time=$row[2]&user=$row[0]&pass=$row[1]\><center>[x]</center></a></td></p>); echo </tr>; $x++; }
I am using this PHP code: if (isset($_GET['c'])) { $pages = array(home, upload, signup);
<?php if (isset($_GET['action']) && (!$_GET['action'] == 'reply')) { ?> <div class=actions> <input type=button onclick=javascript:
I have the following pages: page1.php <?php if (isset($_GET['link'])) { session_start(); $_session['myvariable'] = 'Hello
I got some legacy code that has this: <?PHP if(isset($_GET['pagina'])==homepage) { ?> HtmlCode1 <?php
I have this code <?php session_start(); if (isset($_GET[cmd])) $cmd = $_GET[cmd]; else die(You should
i m using jQuery.get() to delete row from a table from a page main.php
I am using the Database Backup script by David Walsh( http://davidwalsh.name/backup-mysql-database-php ) to backup
<?php if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0) { $dbhost = 'localhost'; $dbuser = 'zuk1_boo'; $dbpass

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.