jbrill Posted July 19, 2007 Share Posted July 19, 2007 im trying to do a simple multiplication equation with the following: //this is the equation for total hours $sumsql = "SELECT SUM(hours) AS totalhours FROM workhours WHERE jobid=$jobid AND stepid=$stepid;"; $sums = mysql_query($sumsql); $sum = mysql_fetch_array($sums); $totalhours = $sum['totalhours']; // this is to calculate the cost $subcat = $result["subcat"]; $getcost = "SELECT * FROM subcategory WHERE subcat='$subcat'"; $costs = mysql_query($getcost); $cost = mysql_fetch_array($costs); $a = $totalhours; $b = $cost; $total = ($a*$b); echo $total; and it is giving me this error: Fatal error: Unsupported operand types in.... Quote Link to comment Share on other sites More sharing options...
chigley Posted July 19, 2007 Share Posted July 19, 2007 Have you tried echo()ing $a and $b to check they're OK? Quote Link to comment Share on other sites More sharing options...
jorgep Posted July 20, 2007 Share Posted July 20, 2007 Are you still having the problem? can you post the whole error message? Quote Link to comment Share on other sites More sharing options...
jbrill Posted July 20, 2007 Author Share Posted July 20, 2007 sorry, .. solved it late at night forgto to check off topic solved 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.