Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to echo sum value in row
    primarykey
    data
    text
    <p>i want to echo sum of 1st script in to 2nd script</p> <p>and both are same page i was try but not working example</p> <pre><code>echo '&lt;td&gt;' . $row['status'] . '&lt;/td&gt;'; echo '&lt;td&gt;' .$final_result4. '&lt;/td&gt;'; </code></pre> <p>how can i do this please help me to fix this issue thanks....</p> <p>this is my 1st script <pre><code> $res1 = (($basicsalary+$allowsalary)*$days*$yeardays1)/$yeardays/$monthdays; $res2 = (($basicsalary1+$allowsalary1)*$days*$yeardays2)/$yeardays/$monthdays; $res3 = (($basicsalary2+$allowsalary2)*$days*$yeardays3)/$yeardays/$monthdays; $res4 = (($basicsalary+$allowsalary)*$days*$yeardays4)/$yeardays/$monthdays; $res5 = (($basicsalary1+$allowsalary1)*$days*$yeardays5)/$yeardays/$monthdays; $res6 = (($basicsalary2+$allowsalary2)*$days*$yeardays6)/$yeardays/$monthdays; $res8 = 221/730*$miscamount +$otheramount; $res7 = $startdays -$enddays; $result1 = number_format((round($res1, 1)),3); $result2 = number_format((round($res2, 1)),3); $result3 = number_format((round($res3, 1)),3); $result4 = number_format((round($res4, 1)),3); $result5 = number_format((round($res5, 1)),3); $result6 = number_format((round($res6, 1)),3); $result7 = number_format((round($res7, 1)),3); $result8 = number_format((round($res8, 1)),3); $final_result = number_format(($result1 +$result2 +$result3 +$result4 +$result5 +$result6 ),3); $final_result2 = number_format((round($final_result/730*$result7 ,1 )),3); $final_result3 = number_format((round(($final_result2 +$result8) , 1)),3); echo $final_result4 = number_format((round(($final_result -$final_result3) , 1)),3); //Ending of php ?&gt; </code></pre> <p>this is my 2nd script</p> <pre><code> echo "&lt;span align='center' class='style2'&gt;Over All Report For The Period Of $a to $b&lt;/span&gt;"; echo "&lt;div id='testTable' id='non-printable'&gt;&lt;table class='hovertable' border='1' cellpadding='10'&gt;"; echo "&lt;tr&gt; &lt;th&gt;Date&lt;/th&gt;&lt;th&gt;Id&lt;/th&gt;&lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Division&lt;/th&gt;&lt;th&gt;Payment&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;th&gt;Total&lt;/th&gt;&lt;/tr&gt;"; // get results1 from database $result1 = mysql_query("SELECT * FROM fullfsaccounts where date BETWEEN '$a' AND '$b' order by date ASC"); while($row = mysql_fetch_array($result1)) { // echo out the contents of each row into a table echo "&lt;tr&gt;"; echo '&lt;td&gt;' . $row['date'] . '&lt;/td&gt;'; echo '&lt;td&gt;' . $row['cardno'] . '&lt;/td&gt;'; echo '&lt;td&gt;' . $row['name'] . '&lt;/td&gt;'; echo '&lt;td&gt;' . $row['division'] . '&lt;/td&gt;'; echo '&lt;td&gt;' . $row['typecash'] . '&lt;/td&gt;'; echo '&lt;td&gt;' . $row['status'] . '&lt;/td&gt;'; echo '&lt;td&gt;' '&lt;/td&gt;'; echo "&lt;/tr&gt;"; //Increment the value of the Total_total variable //by the salary value of one row till the while loop finishes $Total_rows=$num=mysql_num_rows($result1); $Total_total=$Total_total+$row['total']; } echo "&lt;/table&gt;"; echo "&lt;table class='hovertable' border='1' &gt;"; echo "&lt;tr width='100%'&gt;"; echo '&lt;td&gt;Total&lt;/td&gt;'; echo '&lt;td&gt;' . $Total_rows .'&lt;/td&gt;'; echo '&lt;td&gt;' . $Total_total .'&lt;/td&gt;'; echo "&lt;/tr&gt;"; // close table&gt; echo "&lt;/table&gt;"; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload