DEVILofDARKNESS Posted August 12, 2009 Share Posted August 12, 2009 I get the error Unsupported operand types?! How can I solve this? (the error said it was on the last line from the foll. code) $query = "SELECT ammount FROM " . $CoRTable . " WHERE (weapon_id = '$weaponid') AND (" . $CoRIdName . " = '$CoRId')"; $result = mysql_query($query); if(mysql_num_rows($result) == 1){ $curramm = mysql_fetch_row($result); $ammount = $_POST['ammount'] + $curramm; Quote Link to comment Share on other sites More sharing options...
p2grace Posted August 12, 2009 Share Posted August 12, 2009 Try specifying the data type. $ammount = ((double) $_POST['ammount']) + $curramm; Quote Link to comment Share on other sites More sharing options...
Lyleyboy Posted August 12, 2009 Share Posted August 12, 2009 Is it the mySql error? Try adding or die to the end and see what that brings. If you post the actual error message and the code. Quote Link to comment Share on other sites More sharing options...
J.Daniels Posted August 12, 2009 Share Posted August 12, 2009 $curramm is an array. $ammount = $_POST['ammount'] + $curramm; should be: $ammount = $_POST['ammount'] + $curramm[0]; Quote Link to comment Share on other sites More sharing options...
DEVILofDARKNESS Posted August 12, 2009 Author Share Posted August 12, 2009 Thanks I only tried the last solution by J.Daniels, and it worked probably the other solutions worked as well but I will stick with this one untill it fails too 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.