You need to sit down and carefully work through the correct syntax for the 'onclick' bit. The 'onclick' code needs to be surrounded by (escaped) double quotation marks, and the bit following 'window.location=' needs to be in single quotation marks. So the correct code should I think be:
Code: Select all
echo "<td onclick=\"document.location='viewcall.php?id=" . $item['id'] . "&pfx=" . $item['id_prefix'] . "'\">" . substr($item['description'],0,75) . "</td>";
If you are still stuck, have a look at the source code for your web page in your browser. This shows the html that your code is outputting. It is often obvious from that where you have gone wrong, where you have omitted a set of quotation marks etc.
I still do not understand your problem with using a normal html link. Why will this not do what you want?
Code: Select all
echo "<td><a href=\"viewcall.php?id=" . $item['id'] . "&pfx=" . $item['id_prefix'] . "\">" . substr($item['description'],0,75) . "</a></td>";