href not the same as echo
i am reading from a dB
Code:
$query0 = "SELECT * FROM products WHERE productID='$prod' ";
$result0 = mysql_query($query0) or die (mysql_error());
$row0 = mysql_fetch_array($result0);
$newid = $row0['id'];
and when i echo out the "$newid" for testing it seems to work, but when i place it inside a href it takes a refresh click to have that variable change
Code:
<?php
echo $newid;// for test
echo"<a href='product.php?id=";
echo $newid;//doesnt work
echo"&prod=123'>";
}
?>
*the code has been truncated for easy reading