Search code examples
phpmysqlhref

php echo href from mysql issue


Ok, so I have the php echo working and pulling specific url's from the mysql database but this string that I got from an example is adding in single quotes to my href. So instead of being localhost/newdesign/about.php it is localhost/newdesign/'about.php'.

here is the code:

<p>
<?php 
  echo '<a href="\'' . $row['url'] . '\'" style="color: #137e80" (\''.$row['url'].'\');return false;">' . $row['url'] . '</a>'; 
?>
</p>

Thank You


Solution

  • No need for the 2nd apostrophe.

    "' . $row['url'] . '"