Page 1 of 1

Re: HTML HREF inside PHP

Posted: Mon May 07, 2012 5:32 am
by Nullsig
It looks like you are missing semi-colons and brackets.

Code: Select all

if($col==$ar_cols[$last_key]){ 
$re_html .= '<br/>'. $row[$col]; 
echo "<a href=productinfo.php?id=".$row['ProductID'].">View more Details</a>";
}
Adding the curly brackets to group off this section of code the code now reads:

If $col is equal to the $last_key index of $ar_cols do the following.
Concatenate to the end of $re_html a line break and the value of $row[$col].
Then echo out a hyperlink to productinfo.php with the query string of id=$row['productID'].