Solved

php simple sum question part 2

Posted on 2007-11-13
15
203 Views
Last Modified: 2008-03-10
Here is the actual page: http://www.sm4software.com/sm4analysis/sm4analysisview.php?uniqueid=9
with 4 sample Yes No fields (all assumptions above are fine).    However, everything is stored as variables. The ACTUAL field names are 1, 2, 3, 4...which is probably confusing me, as the total should be the total of the Yes answers.

Here is the actual code saved with a .txt extension so you can read it and open it.  Change the .txt to .php after you save it.

http://www.sm4software.com/sm4analysis/sm4analysisview.txt
0
Comment
Question by:glenn_1984
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
15 Comments
 
LVL 21

Expert Comment

by:nizsmo
ID: 20276994
so how are you actually summing the answers up?
i can't actually tell where you are summing up your answer, but i do see these lines:
$sm4analysis->zX->ViewValue = "Yes";

where X is a number from 1-4, i guess this is where you set whether a value is YES or NO am I correct? then can you not just declare say a variable called $counter and set it = 0 initially:

$counter = 0;

then add 1 to the counter each time a value is set to YES?

$sm4analysis->zX->ViewValue = "Yes";
$counter++;

then at the end of your code you can output the counter variable and it would have the number of yes answers.

NOt sure if this is what you are looking for?

0
 
LVL 16

Author Comment

by:glenn_1984
ID: 20280550
It is kind of working, but your example is incrementing the counter regardless of the value of zX.
Do I need to  set an IF ELSE?

Anyway look at page.

Here is a code piece:

<table class="ewTable">
      <tr class="ewTableRow">
            <td class="ewTableHeader">1</td>
            <td<?php echo $sm4analysis->z1->CellAttributes() ?>>
<div<?php echo $sm4analysis->z1->ViewAttributes() ?>><?php echo $sm4analysis->z1->ViewValue ?></div>
<?php
$yescounter=0;
$sm4analysis->z1->ViewValue = "Yes";
$yescounter++;
echo $yescounter
?>
</td>
      </tr>
      <tr class="ewTableAltRow">
            <td class="ewTableHeader">2</td>
            <td<?php echo $sm4analysis->z2->CellAttributes() ?>>
<div<?php echo $sm4analysis->z2->ViewAttributes() ?>><?php echo $sm4analysis->z2->ViewValue ?></div>
<?php
$sm4analysis->z2->ViewValue = "Yes";
$yescounter++;
echo $yescounter
?>

Above only on first two records
And further down...at the end:

<?php

echo $yescounter
?>
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20282856
first, don't forget the ";" after your echo, as you may hav problems later on with syntax errors :)

as for incrementing regardless of zX, is this not what you wanted? to count all the "Yes" answers? regardless of zX we still have to count that YES answer right?
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 16

Author Comment

by:glenn_1984
ID: 20283726
At this link: http://www.sm4software.com/sm4analysis/sm4analysisview.php?uniqueid=6
The number 2 under the first NO
==
No
2
==
is a result of echo $yescounter;

Because this is a NO, yescounter should still be 1, not 2.

I did check the database and am getting 0 and 1 properly in the fields.

To check more...click on sm4analysis and view any data set.
0
 
LVL 16

Author Comment

by:glenn_1984
ID: 20283798
AH...
since the actual data is 0 (no) and 1 (yes) should "Yes" be replaced with 1 in my code?
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20285049
no i don't think it has anything to do with that...
$sm4analysis->z2->ViewValue = "Yes";
this obviously says that the value is YES, so how come it is printint out a NO?

do you have the code where it is printing out a NO?

Obviously if it is a NO then the counter should not increment.
0
 
LVL 16

Author Comment

by:glenn_1984
ID: 20288902
I think this the pertinent code:

<!--

// Write your client script here, no need to add script tags.
// To include another .js script, use:
// ew_ClientScriptInclude("my_javascript.js");
//-->

</script>
<p><span class="phpmaker">View TABLE: sm 4analysis
<br><br>
<a href="sm4analysislist.php">Back to List</a>&nbsp;
<a href="sm4analysisadd.php">Add</a>&nbsp;
</span>
</p>
<?php
if (@$_SESSION[EW_SESSION_MESSAGE] <> "") {
?>
<p><span class="ewmsg"><?php echo $_SESSION[EW_SESSION_MESSAGE] ?></span></p>
<?php
      $_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message
}
?>
<p>
<form>

<table class="ewTable">
      <tr class="ewTableRow">
            <td class="ewTableHeader">1</td>
            <td<?php echo $sm4analysis->z1->CellAttributes() ?>>
<div<?php echo $sm4analysis->z1->ViewAttributes() ?>><?php echo $sm4analysis->z1->ViewValue ?></div>
<?php
$yescounter=0;
$sm4analysis->z1->ViewValue = "Yes";
$yescounter++;
echo $yescounter;
?></td>
      </tr>
      <tr class="ewTableAltRow">
            <td class="ewTableHeader">2</td>
            <td<?php echo $sm4analysis->z2->CellAttributes() ?>>
<div<?php echo $sm4analysis->z2->ViewAttributes() ?>><?php echo $sm4analysis->z2->ViewValue ?></div>
<?php
$sm4analysis->z2->ViewValue = "Yes";
$yescounter++;
echo $yescounter;
?></td>
      </tr>
      <tr class="ewTableRow">
            <td class="ewTableHeader">3</td>
            <td<?php echo $sm4analysis->z3->CellAttributes() ?>>
<div<?php echo $sm4analysis->z3->ViewAttributes() ?>><?php echo $sm4analysis->z3->ViewValue ?></div>
<?php
$sm4analysis->z3->ViewValue = "Yes";
$yescounter++;
?></td>
      </tr>
      <tr class="ewTableAltRow">
            <td class="ewTableHeader">4</td>
            <td<?php echo $sm4analysis->z4->CellAttributes() ?>>
<div<?php echo $sm4analysis->z4->ViewAttributes() ?>><?php echo $sm4analysis->z4->ViewValue ?></div>
<?php
$sm4analysis->z4->ViewValue = "Yes";
$yescounter++;
?></td>
      </tr>
</table>
<p>The code for #2 is</p>
<p>&lt;?php<br />
  $sm4analysis-&gt;z2-&gt;ViewValue = &quot;Yes&quot;;<br />
  $yescounter++;<br />
  echo $yescounter;<br />
  ?&gt; </p>
<p>

<?php

?>
</p>
</form>
<?php

echo $yescounter;
?>
<p>
<script language="JavaScript" type="text/javascript">
<!--

// Write your table-specific startup script here
// document.write("page loaded");
//-->
0
 
LVL 16

Author Comment

by:glenn_1984
ID: 20288905
Here is the whole code
<?php
define("EW_PAGE_ID", "view", TRUE); // Page ID
define("EW_TABLE_NAME", 'sm4analysis', TRUE);
?>
<?php 
session_start(); // Initialize session data
ob_start(); // Turn on output buffering
?>
<?php include "ewcfg50.php" ?>
<?php include "ewmysql50.php" ?>
<?php include "phpfn50.php" ?>
<?php include "sm4analysisinfo.php" ?>
<?php include "userfn50.php" ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1 
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php
 
// Open connection to the database
$conn = ew_Connect();
?>
<?php
 
// Common page loading event (in userfn*.php)
Page_Loading();
?>
<?php
 
// Page load event, used in current page
Page_Load();
?>
<?php
$sm4analysis->Export = @$_GET["export"]; // Get export parameter
$sExport = $sm4analysis->Export; // Get export parameter, used in header
$sExportFile = $sm4analysis->TableVar; // Get export file, used in header
?>
<?php
if (@$_GET["uniqueid"] <> "") {
	$sm4analysis->uniqueid->setQueryStringValue($_GET["uniqueid"]);
} else {
	Page_Terminate("sm4analysislist.php"); // Return to list page
}
 
// Get action
if (@$_POST["a_view"] <> "") {
	$sm4analysis->CurrentAction = $_POST["a_view"];
} else {
	$sm4analysis->CurrentAction = "I"; // Display form
}
switch ($sm4analysis->CurrentAction) {
	case "I": // Get a record to display
		if (!LoadRow()) { // Load record based on key
			$_SESSION[EW_SESSION_MESSAGE] = "No records found"; // Set no record message
			Page_Terminate("sm4analysislist.php"); // Return to list
		}
}
 
// Set return url
$sm4analysis->setReturnUrl("sm4analysisview.php");
 
// Render row
$sm4analysis->RowType = EW_ROWTYPE_VIEW;
RenderRow();
?>
<?php include "header.php" ?>
<script type="text/javascript">
<!--
var EW_PAGE_ID = "view"; // Page id
 
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
 
// Write your client script here, no need to add script tags.
// To include another .js script, use:
// ew_ClientScriptInclude("my_javascript.js"); 
//-->
 
</script>
<p><span class="phpmaker">View TABLE: sm 4analysis
<br><br>
<a href="sm4analysislist.php">Back to List</a>&nbsp;
<a href="sm4analysisadd.php">Add</a>&nbsp;
</span>
</p>
<?php
if (@$_SESSION[EW_SESSION_MESSAGE] <> "") {
?>
<p><span class="ewmsg"><?php echo $_SESSION[EW_SESSION_MESSAGE] ?></span></p>
<?php
	$_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message
}
?>
<p>
<form>
 
<table class="ewTable">
	<tr class="ewTableRow">
		<td class="ewTableHeader">1</td>
		<td<?php echo $sm4analysis->z1->CellAttributes() ?>>
<div<?php echo $sm4analysis->z1->ViewAttributes() ?>><?php echo $sm4analysis->z1->ViewValue ?></div>
<?php
$yescounter=0;
$sm4analysis->z1->ViewValue = "Yes";
$yescounter++;
echo $yescounter;
?></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">2</td>
		<td<?php echo $sm4analysis->z2->CellAttributes() ?>>
<div<?php echo $sm4analysis->z2->ViewAttributes() ?>><?php echo $sm4analysis->z2->ViewValue ?></div>
<?php
$sm4analysis->z2->ViewValue = "Yes";
$yescounter++;
echo $yescounter;
?></td>
	</tr>
	<tr class="ewTableRow">
		<td class="ewTableHeader">3</td>
		<td<?php echo $sm4analysis->z3->CellAttributes() ?>>
<div<?php echo $sm4analysis->z3->ViewAttributes() ?>><?php echo $sm4analysis->z3->ViewValue ?></div>
<?php
$sm4analysis->z3->ViewValue = "Yes";
$yescounter++;
?></td>
	</tr>
	<tr class="ewTableAltRow">
		<td class="ewTableHeader">4</td>
		<td<?php echo $sm4analysis->z4->CellAttributes() ?>>
<div<?php echo $sm4analysis->z4->ViewAttributes() ?>><?php echo $sm4analysis->z4->ViewValue ?></div>
<?php
$sm4analysis->z4->ViewValue = "Yes";
$yescounter++;
?></td>
	</tr>
</table>
<p>The code for #2 is</p>
<p>&lt;?php<br />
  $sm4analysis-&gt;z2-&gt;ViewValue = &quot;Yes&quot;;<br />
  $yescounter++;<br />
  echo $yescounter;<br />
  ?&gt; </p>
<p>
 
<?php
 
?>
</p>
</form>
<?php
 
echo $yescounter;
?>
<p>
<script language="JavaScript" type="text/javascript">
<!--
 
// Write your table-specific startup script here
// document.write("page loaded");
//-->
 
</script>
<?php include "footer.php" ?>
<?php
 
// If control is passed here, simply terminate the page without redirect
Page_Terminate();
 
// -----------------------------------------------------------------
//  Subroutine Page_Terminate
//  - called when exit page
//  - clean up connection and objects
//  - if url specified, redirect to url, otherwise end response
function Page_Terminate($url = "") {
	global $conn;
 
	// Page unload event, used in current page
	Page_Unload();
 
	// Global page unloaded event (in userfn*.php)
	Page_Unloaded();
 
	 // Close Connection
	$conn->Close();
 
	// Go to url if specified
	if ($url <> "") {
		ob_end_clean();
		header("Location: $url");
	}
	exit();
}
?>
<?php
 
// Load row based on key values
function LoadRow() {
	global $conn, $Security, $sm4analysis;
	$sFilter = $sm4analysis->SqlKeyFilter();
	if (!is_numeric($sm4analysis->uniqueid->CurrentValue)) {
		return FALSE; // Invalid key, exit
	}
	$sFilter = str_replace("@uniqueid@", ew_AdjustSql($sm4analysis->uniqueid->CurrentValue), $sFilter); // Replace key value
 
	// Call Row Selecting event
	$sm4analysis->Row_Selecting($sFilter);
 
	// Load sql based on filter
	$sm4analysis->CurrentFilter = $sFilter;
	$sSql = $sm4analysis->SQL();
	if ($rs = $conn->Execute($sSql)) {
		if ($rs->EOF) {
			$LoadRow = FALSE;
		} else {
			$LoadRow = TRUE;
			$rs->MoveFirst();
			LoadRowValues($rs); // Load row values
 
			// Call Row Selected event
			$sm4analysis->Row_Selected($rs);
		}
		$rs->Close();
	} else {
		$LoadRow = FALSE;
	}
	return $LoadRow;
}
 
// Load row values from recordset
function LoadRowValues(&$rs) {
	global $sm4analysis;
	$sm4analysis->z1->setDbValue($rs->fields('1'));
	$sm4analysis->z2->setDbValue($rs->fields('2'));
	$sm4analysis->z3->setDbValue($rs->fields('3'));
	$sm4analysis->z4->setDbValue($rs->fields('4'));
	$sm4analysis->total->setDbValue($rs->fields('total'));
	$sm4analysis->uniqueid->setDbValue($rs->fields('uniqueid'));
}
?>
<?php
 
// Render row values based on field settings
function RenderRow() {
	global $conn, $Security, $sm4analysis;
 
	// Call Row Rendering event
	$sm4analysis->Row_Rendering();
 
	// Common render codes for all row types
	// 1
 
	$sm4analysis->z1->CellCssStyle = "";
	$sm4analysis->z1->CellCssClass = "";
 
	// 2
	$sm4analysis->z2->CellCssStyle = "";
	$sm4analysis->z2->CellCssClass = "";
 
	// 3
	$sm4analysis->z3->CellCssStyle = "";
	$sm4analysis->z3->CellCssClass = "";
 
	// 4
	$sm4analysis->z4->CellCssStyle = "";
	$sm4analysis->z4->CellCssClass = "";
 
	// total
	$sm4analysis->total->CellCssStyle = "";
	$sm4analysis->total->CellCssClass = "";
 
	// uniqueid
	$sm4analysis->uniqueid->CellCssStyle = "";
	$sm4analysis->uniqueid->CellCssClass = "";
	if ($sm4analysis->RowType == EW_ROWTYPE_VIEW) { // View row
 
		// 1
		if (!is_null($sm4analysis->z1->CurrentValue)) {
			switch ($sm4analysis->z1->CurrentValue) {
				case "1":
					$sm4analysis->z1->ViewValue = "Yes";
					break;
				case "0":
					$sm4analysis->z1->ViewValue = "No";
					break;
				default:
					$sm4analysis->z1->ViewValue = $sm4analysis->z1->CurrentValue;
			}
		} else {
			$sm4analysis->z1->ViewValue = NULL;
		}
		$sm4analysis->z1->CssStyle = "";
		$sm4analysis->z1->CssClass = "";
		$sm4analysis->z1->ViewCustomAttributes = "";
 
		// 2
		if (!is_null($sm4analysis->z2->CurrentValue)) {
			switch ($sm4analysis->z2->CurrentValue) {
				case "1":
					$sm4analysis->z2->ViewValue = "Yes";
					break;
				case "0":
					$sm4analysis->z2->ViewValue = "No";
					break;
				default:
					$sm4analysis->z2->ViewValue = $sm4analysis->z2->CurrentValue;
			}
		} else {
			$sm4analysis->z2->ViewValue = NULL;
		}
		$sm4analysis->z2->CssStyle = "";
		$sm4analysis->z2->CssClass = "";
		$sm4analysis->z2->ViewCustomAttributes = "";
 
		// 3
		if (!is_null($sm4analysis->z3->CurrentValue)) {
			switch ($sm4analysis->z3->CurrentValue) {
				case "1":
					$sm4analysis->z3->ViewValue = "yes";
					break;
				case "0":
					$sm4analysis->z3->ViewValue = "No";
					break;
				default:
					$sm4analysis->z3->ViewValue = $sm4analysis->z3->CurrentValue;
			}
		} else {
			$sm4analysis->z3->ViewValue = NULL;
		}
		$sm4analysis->z3->CssStyle = "";
		$sm4analysis->z3->CssClass = "";
		$sm4analysis->z3->ViewCustomAttributes = "";
 
		// 4
		if (!is_null($sm4analysis->z4->CurrentValue)) {
			switch ($sm4analysis->z4->CurrentValue) {
				case "1":
					$sm4analysis->z4->ViewValue = "Yes";
					break;
				case "0":
					$sm4analysis->z4->ViewValue = "no";
					break;
				default:
					$sm4analysis->z4->ViewValue = $sm4analysis->z4->CurrentValue;
			}
		} else {
			$sm4analysis->z4->ViewValue = NULL;
		}
		$sm4analysis->z4->CssStyle = "";
		$sm4analysis->z4->CssClass = "";
		$sm4analysis->z4->ViewCustomAttributes = "";
 
		// total
		$sm4analysis->total->ViewValue = $sm4analysis->total->CurrentValue;
		$sm4analysis->total->CssStyle = "";
		$sm4analysis->total->CssClass = "";
		$sm4analysis->total->ViewCustomAttributes = "";
 
		// uniqueid
		$sm4analysis->uniqueid->ViewValue = $sm4analysis->uniqueid->CurrentValue;
		$sm4analysis->uniqueid->CssStyle = "";
		$sm4analysis->uniqueid->CssClass = "";
		$sm4analysis->uniqueid->ViewCustomAttributes = "";
 
		// 1
		$sm4analysis->z1->HrefValue = "";
 
		// 2
		$sm4analysis->z2->HrefValue = "";
 
		// 3
		$sm4analysis->z3->HrefValue = "";
 
		// 4
		$sm4analysis->z4->HrefValue = "";
 
		// total
		$sm4analysis->total->HrefValue = "";
 
		// uniqueid
		$sm4analysis->uniqueid->HrefValue = "";
	} elseif ($sm4analysis->RowType == EW_ROWTYPE_ADD) { // Add row
	} elseif ($sm4analysis->RowType == EW_ROWTYPE_EDIT) { // Edit row
	} elseif ($sm4analysis->RowType == EW_ROWTYPE_SEARCH) { // Search row
	}
 
	// Call Row Rendered event
	$sm4analysis->Row_Rendered();
}
?>
<?php
 
// Set up Starting Record parameters based on Pager Navigation
function SetUpStartRec() {
	global $nDisplayRecs, $nStartRec, $nTotalRecs, $nPageNo, $sm4analysis;
	if ($nDisplayRecs == 0) return;
 
	// Check for a START parameter
	if (@$_GET[EW_TABLE_START_REC] <> "") {
		$nStartRec = $_GET[EW_TABLE_START_REC];
		$sm4analysis->setStartRecordNumber($nStartRec);
	} elseif (@$_GET[EW_TABLE_PAGE_NO] <> "") {
		$nPageNo = $_GET[EW_TABLE_PAGE_NO];
		if (is_numeric($nPageNo)) {
			$nStartRec = ($nPageNo-1)*$nDisplayRecs+1;
			if ($nStartRec <= 0) {
				$nStartRec = 1;
			} elseif ($nStartRec >= intval(($nTotalRecs-1)/$nDisplayRecs)*$nDisplayRecs+1) {
				$nStartRec = intval(($nTotalRecs-1)/$nDisplayRecs)*$nDisplayRecs+1;
			}
			$sm4analysis->setStartRecordNumber($nStartRec);
		} else {
			$nStartRec = $sm4analysis->getStartRecordNumber();
		}
	} else {
		$nStartRec = $sm4analysis->getStartRecordNumber();
	}
 
	// Check if correct start record counter
	if (!is_numeric($nStartRec) || $nStartRec == "") { // Avoid invalid start record counter
		$nStartRec = 1; // Reset start record counter
		$sm4analysis->setStartRecordNumber($nStartRec);
	} elseif (intval($nStartRec) > intval($nTotalRecs)) { // Avoid starting record > total records
		$nStartRec = intval(($nTotalRecs-1)/$nDisplayRecs)*$nDisplayRecs+1; // Point to last page first record
		$sm4analysis->setStartRecordNumber($nStartRec);
	} elseif (($nStartRec-1) % $nDisplayRecs <> 0) {
		$nStartRec = intval(($nStartRec-1)/$nDisplayRecs)*$nDisplayRecs+1; // Point to page boundary
		$sm4analysis->setStartRecordNumber($nStartRec);
	}
}
?>
<?php
 
// Page Load event
function Page_Load() {
 
	//echo "Page Load";
}
 
// Page Unload event
function Page_Unload() {
 
	//echo "Page Unload";
}
?>

Open in new window

0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20292491
where does it actually set the variable to a NO?
0
 
LVL 16

Author Comment

by:glenn_1984
ID: 20292906
Look at lines 117 to 121
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20292920
$sm4analysis->z2->ViewValue = "Yes";
$yescounter++;
echo $yescounter;

isn't that setting it to a Yes? sorry just trying to understand your code.
0
 
LVL 16

Author Comment

by:glenn_1984
ID: 20301563
Originally I just cut your code from the top of this thread.

It then occurred to me that I might, indeed be setting the variable to YES

So I attempted
if ( $sm4analysis->z2->ViewValue = "Yes" ) {
      $yescounter++;
}
echo $yescounter;
?>

That did not work either
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20301743
i had a look through your whole code, and the only reference i can find a "no" assigned is here. should we be doing something like this?


if ($sm4analysis->RowType == EW_ROWTYPE_VIEW) { // View row
 
		// 1
		if (!is_null($sm4analysis->z1->CurrentValue)) {
			switch ($sm4analysis->z1->CurrentValue) {
				case "1":
					$sm4analysis->z1->ViewValue = "Yes";
$yescounter++;
					break;
				case "0":
					$sm4analysis->z1->ViewValue = "No";
					break;
				default:
					$sm4analysis->z1->ViewValue = $sm4analysis->z1->CurrentValue;
			}
		} else {
			$sm4analysis->z1->ViewValue = NULL;
		}
		$sm4analysis->z1->CssStyle = "";
		$sm4analysis->z1->CssClass = "";
		$sm4analysis->z1->ViewCustomAttributes = "";
 
		// 2
		if (!is_null($sm4analysis->z2->CurrentValue)) {
			switch ($sm4analysis->z2->CurrentValue) {
				case "1":
					$sm4analysis->z2->ViewValue = "Yes";
$yescounter++;
					break;
				case "0":
					$sm4analysis->z2->ViewValue = "No";
					break;
				default:
					$sm4analysis->z2->ViewValue = $sm4analysis->z2->CurrentValue;
			}
		} else {
			$sm4analysis->z2->ViewValue = NULL;
		}
		$sm4analysis->z2->CssStyle = "";
		$sm4analysis->z2->CssClass = "";
		$sm4analysis->z2->ViewCustomAttributes = "";
 
		// 3
		if (!is_null($sm4analysis->z3->CurrentValue)) {
			switch ($sm4analysis->z3->CurrentValue) {
				case "1":
					$sm4analysis->z3->ViewValue = "yes";
$yescounter++;
					break;
				case "0":
					$sm4analysis->z3->ViewValue = "No";
					break;
				default:
					$sm4analysis->z3->ViewValue = $sm4analysis->z3->CurrentValue;
			}
		} else {
			$sm4analysis->z3->ViewValue = NULL;
		}

Open in new window

0
 
LVL 21

Accepted Solution

by:
nizsmo earned 500 total points
ID: 20301745
sorry forgot to mention, this is just a subsection of your full code posted before.
0
 
LVL 16

Author Comment

by:glenn_1984
ID: 20366548
My PC had crashed...sorry for the delay.
However... I cannot get this to work.
Will try more later.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Session time out quickly. 6 55
Displaying a google org chart from php/mysql code 27 47
if statement malfunction 5 44
Phone number mask 4 14
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question