Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHPRunner and Simple Math

Status
Not open for further replies.

CecilXavier

Technical User
Oct 2, 2007
104
US
I'm a very novice coder. I am trying to add a simple math function in my code. I'm using this product called PHPRunner. When I try to add code to mutliply two numbers queried from my sql database it muffs up on me. This is what I am looking at.
style="BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-RIGHT: black 1px solid"
class=report border=0 cellSpacing=0 cellPadding=1 width=auto>
<TBODY>
<TR>
<TD style="WIDTH: 97px" class=blackshade>Number of Images</TD>
<TD style="WIDTH: 297px" class=blackshade>Number of Repeated Images</TD></TR>{BEGIN grid_row}{END grid_row}
<TR>
<TD style="WIDTH: 97px" class=blackshade>Number of Images</TD>
<TD style="WIDTH: 297px" class=blackshade>Number of Repeated Images</TD></TR><!--------------------------------------global summary-------------------------------------------->
<TR>
<TD style="WIDTH: 399px" class=globalsummary colSpan=2>Global summary
{$global_total_cnt} -
records total</TD></TR><!-- Sum -->
<TR>
<TD style="WIDTH: 97px" class=globalsummary>Sum&nbsp; {$global_totalNumImag_sum} </TD>
<TD style="WIDTH: 297px" class=globalsummary>{$global_totalNumRep_sum} </TD></TR>
<TR height=36>
<TD style="WIDTH: 97px">&nbsp;AVG</TD>
<TD style="WIDTH: 297px">&nbsp;

</TD></TD></TR></TBODY></TABLE></DIV>{END grid_block}</DIV>

Where the space is I'm trying to get {$global_totalNumRep_sum} divided by {$global_totalNumImag_sum} times 100.
This seems like it is very simple and I just cannot see it. Any help would be greatly appreciated.
 
So, I fixed this one. It ended up that I used the SQL Query to get the information that I wanted. I made sure to name the query as something. Not just leaving it tagged as the query. I called it "Percent of repeats". I then told the PHPrunner program to use the query as a column and to avg it. Worked like a charm.
 
thanks for posting back.

i've never touched phprunner. can you share with the forum why you are using it and not rolling your own app and framework? eg. what advantages is the abstract framework providing you with?

you say in your first post that you are a novice. If so I'd strongly counsel you to abandon all frameworks (like cake etc) and rad tools (like dreamweaver) and suggest instead that you go back to basics with raw php. learn what it is doing before you entrust your apps to a framework created by someone else.
 
Hey Jpadie,
Sorry for the late response. I'm in a situation where I have to put band-aids on what was left to me by a former employee. The product that was used was PHP runner. The framework was already there. I just have to fix the issues that come up. Could you point me at a place to start?
 
the place to start is stripping out everything to do with phprunner and going back to raw code. until you understand what phprunner is doing for you, it's really not a good idea to be using it.
 
I have PHP Runner also and find it very limited. It is quick for simple applications, but if you want to make custom screens or calculations, it is a nightmare!!
 
php is such a simple and powerful language that i've never been able to see the sense in using frameworks like cake and phprunner.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top