Hi chris
thanks for having a read through, i have made the above alteration you surgested but the code is still not executing or showing a singel 'echo'. Here is the code again including the alterations if anything else jumps out please post it up. Thanks in advance.
<?php
include ("constants.inc");
$connection = mysql_connect($GLOBALS['host'],$GLOBALS['user'],$GLOBALS['pass']) or die ("couldn't connect to server");
echo ('got here 1');
$db = mysql_select_db ($GLOBALS['db_name'], $connection) or die ("Unable to select the database");
$setquery = "SELECT paypal_name FROM settings WHERE clubid = 1";
$setres = mysql_query($setquery);
$setquery = mysql_fetch_assoc($setres);
$setquery = $setquery['paypal_name'];
echo ('got here 2');
$stockquery = "SELECT * FROM stock ORDER BY itemid";
$stockres = mysql_query($stockquery);
echo ('got here 3');
<html>
while ($row = mysql_fetch_assoc($stockres, MYSQL_BOTH)) {
if $row['stock'] => 1 then {
<!--this uses only the guest price so a variable will been to be set if they login as members to pull identical code with their price-->
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="<?php echo $setquery['paypal_name']; ?>">
<input type="hidden" name="item_name" value="<?php echo $stockquery['name']; ?>">
<input type="hidden" name="item_number" value="<?php echo $stockquery['itemid']; ?>">
<input type="hidden" name="amount" value="<?php echo $stockquery['guest_price']; ?>">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="return" value="http://www.danwinder.co.uk">
<input type="hidden" name="cancel_return" value="http://www.danwinder.co.uk">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="lc" value="GB">
</form>
}
}
</html>
mysql_free_result($setres);
mysql_free_result($stockres);
?>