nbajpai nbajpai - 2 months ago 5x
MySQL Question

How to give echo '<a href="view2.php?id=' . $id . '">' . $name . '</a>'; in html

i got this

'echo <a href="view2.php?id=' . $id . '">' . $name . '</a>';

as working code in php but how can I use it in html ?
I want to use it as links in html


You forgot a ' after echo

echo '<a href="view2.php?id='.$id.'">'.$name.'</a>';

Also make sure your file has .php extension not .html. php only works in .php files


If 'echo <a href="view2.php?id=' . $id . '">' . $name . '</a>'; is what you truly have, look at the example above of where the first ' should be.