jkkenzie Posted May 10, 2008 Share Posted May 10, 2008 The below part which is found in full code below it, causes my result on my page to disappear i.e no result come out at all. where am i going wrong? I have /* */ it so that it gives me results but i need this part of the code to work to complete my results. Does php dont go beyond this point? /* while($rows13 = mysql_fetch_array($getresults2)) { $sum=$sum+$rows13['Par_Value']; $n++; }*/ Full code here... <?php //get project id $getproid = mysql_query("SELECT projectid FROM tblprojects WHERE projectname='".$_POST['project']."'"); $proidval = mysql_fetch_assoc($getproid); $proid = $proidval['projectid']; //get parameter id $getparid = mysql_query("SELECT Par_Id FROM tblparameter WHERE strName='".$_POST['parametername']."'"); $paridval = mysql_fetch_assoc($getparid); $parid = $paridval['Par_Id']; //Get countries and their parameter values according to users Project $getresults = mysql_query("SELECT DISTINCT strCountry FROM tblcountries WHERE Par_Id='$parid' AND projectid='$proid' ORDER BY strCountry"); $count=0; while($rows11 = mysql_fetch_array($getresults)) { $countryname[]=$rows11['strCountry']; $count++; } echo "<table border='1' align='center'> <tr> <b>YOUR PROJECT DATA</b></tr> <tr>"; $count2=0; while($count2<=$count) { echo "<th>".$countryname[$count2]."</th><th> A Values</th><th> C Values</th>"; echo"</tr>"; echo "<tr>"; $getresults2 = mysql_query("SELECT Par_Value FROM tblcountries WHERE Par_Id='$parid' AND projectid='$proid' AND strCountry='$countryname[$count2]' ORDER BY strCountry"); $n=0; $sum=0; /* while($rows13 = mysql_fetch_array($getresults2)) { $sum=$sum+$rows13['Par_Value']; $n++; }*/ while($rows12 = mysql_fetch_array($getresults2)) { echo "<tr><td>" . $rows12['Par_Value'] . "</td>"; $a2 = $rows12['Par_Value']*$rows12['Par_Value']; $A= sqrt(1/$n*$sum*$a2); echo "<td>".$A ."</td>"; echo "<td>C</td></tr>"; } echo "</tr>"; $count2++; } echo "</table>"; ?> Thanks in advance... Regards, Joseph Link to comment https://forums.phpfreaks.com/topic/104990-where-am-i-going-wrong-here/ Share on other sites More sharing options...
gnawz Posted May 10, 2008 Share Posted May 10, 2008 Please provide the complete code of the commented code. I however, think it has a question to do with your mysql queries(try fetch_rows or fetch_affected_rows for fetching or your conditions are conflicting. Get back if stuck Link to comment https://forums.phpfreaks.com/topic/104990-where-am-i-going-wrong-here/#findComment-537395 Share on other sites More sharing options...
jkkenzie Posted May 10, 2008 Author Share Posted May 10, 2008 The commented code is complete as it is. Just remove the comment /* */. The result come out without the commented code. BUT when uncommented, it does not show any results. that is the part am stuck Thanks again. Link to comment https://forums.phpfreaks.com/topic/104990-where-am-i-going-wrong-here/#findComment-537404 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.