All pastes #427537 Raw Edit

Unnamed

public php v1 · immutable
·published 2007-04-06 20:47 UTC
rendered paste body
<?php	function getResultAsTable()	{		if ($this->numrows() > 0)		{			$resultHTML = "<table border ='1'\n<tr>\n";				$fieldCount = $this->numberFields();				for ($i = 0; $i < $fieldCount; $i++)			{				$rowName = $this->fieldName($i);				$resultHTML .= "<th>$rowName</th>";			}			$resultHTML .= "</tr>\n";				while ($row = $this->fetchRow())			{				$resultHTML .= "<tr>\n";				for ($i = 0; $i < $fieldCount; $i++)					$resultHTML .= "<td>".htmllentities($row[$i])."</td>";				$resultHTML .= "</tr>\n";			}								$resultHTML .="</table>";		}		else		{			$resultHTML = "Yhtään tuloksia tietokantakyselyssä ei ilmennyt.";		}				return $resultHTML;	}}############## LOL ##############	function getResultAsTable() {				if ($this->numrows() > 0) {			$resultHTML = "<table border ='1'\n<tr>\n";				$fieldCount = $this->numberFields();						for ($i = 0; $i < $fieldCount; $i++) {				$rowName = $this->fieldName($i);				$resultHTML .= "<th>$rowName</th>";			}					$resultHTML .= "</tr>\n";						while ($row = $this->fetchRow()) {				$resultHTML .= "<tr>\n";				for ($i = 0; $i < $fieldCount; $i++) {					$resultHTML .= "<td>".htmllentities($row[$i])."</td>";					$resultHTML .= "</tr>\n";			}						$resultHTML .="</table>";		}				else {			$resultHTML = "Yhtään tuloksia tietokantakyselyssä ei ilmennyt."		}				return $resultHTML;	}?>