• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

if statement just about works - but getting partial error

just about there with this if statement but getting an error:

<?php if ($_GET['Itemid']=="53")
 { echo
"<div id=\"subTitleBar\">
<div id=\"yellowArrow\" style=\"margin-top:5px;\">
   
      
                          <div class=\"moduletableArrowPad\">
                              <img src=\"templates/levy1/images/yellow_arrow.gif\" alt=\"Levy Angstreich Finney Baldante Rubenstein and Coren, P.C., Attorneys \" title=\"Levy Angstreich Finney Baldante Rubenstein and Coren, P.C., Attorneys \" />                        </div>

      
        
  </div> <div class=\"componentheading\" style=\"color:#910027;\">ASSOCIATES</div></div>
do {
<div id=\"associateContainer\"> ".$row_rsAssociates['introtext']."<br>
 ".$row_rsAssociates['title']."<br>
  <a href=\"index.php?view=article&id=".$row_rsAssociates['id'].":".$row_rsAssociates['alias']."&Itemid=53&option=com_content\" class=\"contentpagetitle$this->params->get( 'pageclass_sfx' )\">Profile</a></div>
 } while ($row_rsAssociates = mysql_fetch_assoc($rsAssociates))";}?>
0
phillystyle123
Asked:
phillystyle123
  • 2
1 Solution
 
nizsmoDeveloperCommented:
What exactly is the error? No syntax errors in there, however 1 weird thing about your code is that you have your do-while statemtn within your echo, is this done on purpose?

Correct code should be below which fits a do-while loop in the if statement, and should output everything correctly.


<?php

if ($_GET['Itemid']=="53")
 {
       echo
            "<div id=\"subTitleBar\">
            <div id=\"yellowArrow\" style=\"margin-top:5px;\">
                          <div class=\"moduletableArrowPad\">
                              <img src=\"templates/levy1/images/yellow_arrow.gif\" alt=\"Levy Angstreich Finney Baldante Rubenstein and Coren, P.C., Attorneys \" title=\"Levy Angstreich Finney Baldante Rubenstein and Coren, P.C., Attorneys \" />  </div>
              </div> <div class=\"componentheading\" style=\"color:#910027;\">ASSOCIATES</div></div>";
            do {
                  echo "
            <div id=\"associateContainer\"> ".$row_rsAssociates['introtext']."<br>
             ".$row_rsAssociates['title']."<br>
              <a href=\"index.php?view=article&id=".$row_rsAssociates['id'].":".$row_rsAssociates['alias']."&Itemid=53&option=com_content\" class=\"contentpagetitle$this->params->get( 'pageclass_sfx' )\">Profile</a></div>";
             } while ($row_rsAssociates = mysql_fetch_assoc($rsAssociates));
 }

?>

Let me know how you go.
0
 
phillystyle123Author Commented:
perfecto - that's exactly what was wrong - thanks for the help!
0
 
nizsmoDeveloperCommented:
Glad to be of assistance.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now