How do i get this or correct this PHP logic Working

wubaz

New Member
I am creating a report with the data which calls the stored procedure and that procedure returns various sections (1,2,3,4,5,6) with the data in each section.Now the sections may contain or may not contain the data.This is how i have wriiten my logic \[code\] foreach($this->$dbresults as $row){$var1 =''; If($var1!=$row['section']){switch($row['section']){case '1':echo "some thing data"; break;case '2':echo "some thing data"; break;case '3':echo "some thing data"; break;case '4':echo "some thing data"; break;case '5':echo "some thing data"; break;case '6':echo "some thing data"; break;} } $var1=$row['section']}\[/code\]So here My problem if any one of the section is not present then that section case cannot be executed .I mean How do i execute the section even if the section is not returned from the database
 
Back
Top