Title: HTML with PHP While statement breaks Elementor
Last modified: January 2, 2022

---

# HTML with PHP While statement breaks Elementor

 *  [ericjs61](https://wordpress.org/support/users/ericjs61/)
 * (@ericjs61)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/html-with-php-while-statement-breaks-elementor/)
 * This is so strange. I added an HTML Select and added PHP While statement to a
   Universal Snippet and it breaks Elementor. If you remove the PHP comments, it
   breaks Elementor. I do this in an Elementor Single Structure section. See the
   code below:
 *     ```
       	<form method='POST'>
       		<select name="formLeagueType" id="LeagueType" required>
       				<option value="">Select Your League Type....</option>
       			<?php //while($row1 = mysqli_fetch_assoc($result_LeagueType)):;?>
       			<option value=<?php echo $row1['league_type_id'];?>><?php echo $row1['league_name'];?></option>
       			<?php //endwhile;?>
       		</select>	
       		<input type="submit" name="submitCAP" value="Step 2" Style = "color:white; background-color:blue" required>		
       	</form>
       ```
   
    -  This topic was modified 4 years, 5 months ago by [ericjs61](https://wordpress.org/support/users/ericjs61/).
    -  This topic was modified 4 years, 5 months ago by [ericjs61](https://wordpress.org/support/users/ericjs61/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhtml-with-php-while-statement-breaks-elementor%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [ericjs61](https://wordpress.org/support/users/ericjs61/)
 * (@ericjs61)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/html-with-php-while-statement-breaks-elementor/#post-15212580)
 * I just used an older woody snippet and copied my code to it and now it works.
 * The older snippet was published Oct 23rd 2020
    The newer snippet was published
   Jan 2nd 2022
 * Something changed in your updates that broke this option.
 *  Thread Starter [ericjs61](https://wordpress.org/support/users/ericjs61/)
 * (@ericjs61)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/html-with-php-while-statement-breaks-elementor/#post-15214550)
 * I am really getting a little annoyed that one snippet will work and another snippet
   with the same code will fail. Using the same type of snippet, universal snippet,
   so I can use PHP and HTML.
 * This is getting so inconsistent. Can someone explain this to me?
 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/html-with-php-while-statement-breaks-elementor/#post-15234314)
 * Hello.
 * There are errors in your PHP code. For example, an extra semicolon after while.
   
   The plugin itself only executes PHP code. If there are errors in it, then the
   site is displayed incorrectly.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘HTML with PHP While statement breaks Elementor’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3523853)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

## Tags

 * [html](https://wordpress.org/support/topic-tag/html/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [while](https://wordpress.org/support/topic-tag/while/)

 * 3 replies
 * 2 participants
 * Last reply from: [Temyk](https://wordpress.org/support/users/webtemyk/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/html-with-php-while-statement-breaks-elementor/#post-15234314)
 * Status: not resolved