nbajpai nbajpai - 1 year ago 84
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

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download