Jump to content

Help with formula in query?


phpmo

Recommended Posts

$hsel = mysql_query("select id,name,(stata-statb) as nstata,statc,(nstata*2+statc*5-statb*2) as statd from table order by statd desc, id asc limit 100");

 

Trying to get the formula to work in this query...I"ve never really mess with major formulas so this one is throwing me for a loop.

 

Any help would be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/99609-help-with-formula-in-query/
Share on other sites

This is what I have above. I'm not getting anything. It's actually coming back as a syntax error. I haven't really fine tuned the formula yet but I need to do it based of fields in a table as I've posted above.

 

All I'm asking is should that work since it's not working now. What am I missing.

What I"m asking is the query correct. I changed the tablename to table simply because I'm anal and don't like the names of all my tables etc on the net.

 

All table names etc are correct but something must be wrong with the way I have the query written using the math calculations.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.