Jump to content

[SOLVED] My php code is crashing...


vozzek

Recommended Posts

... Dreamweaver CS3  ::)

 

First off, yes, I know Dreamweaver is a big steaming pile of Mickey Mouse dog crap.  I was new when I bought it and I'm past that.

 

Second, I'm very new to php and my code probably sucks.  So please go easy on me, and I'm certainly open to alternate and better ways to do this.  The code below is all mine, meaning I wrote it from scratch and didn't use any Romper Room DW php builder to create it.

 

Quick rundown: I'm populating a detail page from my SQL database. If an option (for example "option_a") exists, I want the dropdown list to populate with all available selections for that particular option. An example for option_a would be 'Color', and the listbox selections (a1, a2, a3...) would be something like "blue", "green", or "red". The code is attached below:

 

<?php if (!empty($row_rs_detail['option_a'])) { ?>
  <label>
  <?php echo $row_rs_detail['option_a'].":"; ?>
  <select name=<?php echo $row_rs_detail['option_a']; ?> id=<?php echo $row_rs_detail['option_a']; ?>>
  
  <?php
   echo "<option selected='yes'>Please Select</option>";
   if (!empty($row_rs_detail['option_a1'])) {
      echo "<option>{$row_rs_detail['option_a1']}</option>";
   }
   if (!empty($row_rs_detail['option_a2'])) {
      echo "<option>{$row_rs_detail['option_a2']}</option>";
   }
   if (!empty($row_rs_detail['option_a3'])) {
      echo "<option>{$row_rs_detail['option_a3']}</option>";
   }
   ?>
   </select>
  </label>
<?php } ?>

 

DW is crashing the SECOND I close that </select> tag near the end.  I was wondering if anything in my php code should be causing this crash to happen.

 

The really strange thing is this was working for several weeks. All of a sudden, it doesn't work anymore. I wonder if there's a control character in there or something, or maybe I deleted an important character? Thanks in advance for the help.

 

 

Link to comment
https://forums.phpfreaks.com/topic/76541-solved-my-php-code-is-crashing/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.