kyleldi Posted March 12, 2009 Share Posted March 12, 2009 Though I thought I had this right, I've got two 'do' cmds in my statement to pull information from the db, yet I keep getting an error of an unexpected }. The first do cmd is assembled the same way and it works just fine... <?php if(isset($_GET['category'])){ echo "<div class='catdetail_header'><h1 class='style1'>".ucwords($row_rs_multi_dl['category'])."</h1></div>"; do { echo '<div class="catdetail_header"><h1 class="style1">'.ucwords($row_rs_multi_dl['title']).'</h1></div> <div class="catdetail_desc"><p>'.$row_rs_multi_dl['description'].'</p></div> <div class="catdetail_footer"><a href="downloads/'.$row_rs_multi_dl['filetype'].'/'.$row_rs_multi_dl['filename'].'">Download Now</a></div>'; } while($row_rs_multi_dl = mysql_fetch_assoc($rs_multi_dl)); } do { echo '<div class="thumbframe"> <div class="thumb"><a href="downloads.php?category='.$row_rs_multi_cats['category'].'"><img src="images/downloads/'.$row_rs_multi_cats['category'].'.jpg" alt="'.$row_rs_multi_cats['category'].'" width="100" height="58" border="0" longdesc="downloads.php?category='.$row_rs_multi_cats['category'].'" /></a></div> <div>'.ucwords($row_rs_multi_cats['category']).'</div></div>'; } while ($row_rs_multi_cats = mysql_fetch_assoc($rs_multi_cats)); } else{ echo "<div class='catdetail_header'><h1 class='style1'>Please Choose A Category</h1></div>"; do { echo '<div class="catdetail_header"><h1 class="style1"><a href="downloads.php?category='.$row_rs_showcats['category'].'">'.ucwords($row_rs_showcats['category']).'</a></h1></div>'; } while($row_rs_showcats = mysql_fetch_assoc($rs_showcats)); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/149145-solved-if-statement-trouble/ Share on other sites More sharing options...
jackpf Posted March 12, 2009 Share Posted March 12, 2009 It'd be useful if you stated what line the unexpected bracket was on... Quote Link to comment https://forums.phpfreaks.com/topic/149145-solved-if-statement-trouble/#findComment-783132 Share on other sites More sharing options...
Philip Posted March 12, 2009 Share Posted March 12, 2009 while($row_rs_multi_dl = mysql_fetch_assoc($rs_multi_dl)); } That } afterwards is not needed. Proper indenting would help Quote Link to comment https://forums.phpfreaks.com/topic/149145-solved-if-statement-trouble/#findComment-783133 Share on other sites More sharing options...
kyleldi Posted March 12, 2009 Author Share Posted March 12, 2009 Removing the bracket gives me an unexpected T_ELSE error on the line else{ <div>'.ucwords($row_rs_multi_cats['category']).'</div></div>'; } while ($row_rs_multi_cats = mysql_fetch_assoc($rs_multi_cats)); else{ //this line is what fails // Quote Link to comment https://forums.phpfreaks.com/topic/149145-solved-if-statement-trouble/#findComment-783137 Share on other sites More sharing options...
Philip Posted March 12, 2009 Share Posted March 12, 2009 You deleted it from the wrong location. Note: _dl, not _cats Quote Link to comment https://forums.phpfreaks.com/topic/149145-solved-if-statement-trouble/#findComment-783139 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.