Ive got the code:

mysql_query("UPDATE members SET gold=gold+$sellprice WHERE email='$player[email]' ")or die(mysql_error());

To add gold to a users account in the database but this doesn't work every time I run the script instead of adding on the new value to the old one it just
sets the gold to zero, ive tried echoing $sellprice and it does contain values and Ive checked the database and everything is valid.

Any ideas?

This is really a SQL question... It's best asked at the SQL forum.

I think your problem is here, though:

SET gold=gold+$sellprice

Get gold from the database first, do the math, then set gold='$newgoldamount'

At least that's how I'd do it...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.