Orionsbelter Posted June 5, 2008 Share Posted June 5, 2008 hi i have recently bought a sever and dont know much about them but noticed now i've moved my website onto my own sever it wont do the following: $user=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'")); $newcash=1000; ////////// here is where is doesn't work it doesn't add these together $newmoney=$user->money + $newcash; mysql_query("UPDATE users SET money='$newmoney' WHERE username='$username'"); however it will do this: ////// it'll minus the money just dont add it. $newmoney=$user->money - $newcash; mysql_query("UPDATE users SET money='$newmoney' WHERE username='$username'"); and it'll do this: mysql_query("UPDATE users SET money=money+$newcash WHERE username='$username'"); this worked perfectly on my hosting account now i have my own sever it seems to be a problem what dod i need to configure to make it work? thanks Quote Link to comment Share on other sites More sharing options...
Sulman Posted June 5, 2008 Share Posted June 5, 2008 Have you moved to a different version of php? You may need to check this as sites built on one version can break on differnent ones (particularly with classes from php 5-> 4 as 4 doesn't support "public" "private") Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 5, 2008 Share Posted June 5, 2008 The only reasonably way that would fail is if the values were close to the limit that could be held in a variable or in your column in your table. Show what the actual values are that don't work. What are $newmoney and $user->money when you echo them? If they echo correctly, post your table definition. Also, you don't state exactly what it is doing? Is there a php or mysql error? Does the value stay the same? Does the value change but is not correct? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.