Better way to incorporate HTML and PHP When I look at this style of code I feel like there has to be a better way to write this:

&lt;div id="by_cx"&gt;
    &lt;!-- free text input for name --&gt;
    &lt;label&gt;Name:&lt;input type="text" id="cxByNameInput" name="cxByNameInput"/&gt;&lt;/label&gt;
    &lt;!-- cx state drop down --&gt;
    &lt;label for="cxState"&gt;State:&lt;/label&gt;
    &lt;select id="cxState"&gt;
        &lt;option&gt;&lt;/option&gt;
    &lt;?$states = getStates();
    while($state = $states-&gt;fetch_assoc())
    {?&gt;
        &lt;option value="&lt;?=$state['st']?&gt;"&gt;&lt;?=$state['state']?&gt;&lt;/option&gt;
    &lt;?}?&gt;
    &lt;/select&gt;
    &lt;!-- cx status drop down --&gt;
    &lt;label for="cxStatus"&gt;Status&lt;/label&gt;
    &lt;select id="cxStatus"&gt;
        &lt;option&gt;&lt;/option&gt;
    &lt;?$statusList = getCxStatusList();
    while($status = $statusList-&gt;fetch_assoc())
    {?&gt;
        &lt;option value="&lt;?=$status['cxType']?&gt;"&gt;&lt;?=$status['cxTypeDescription']?&gt;&lt;/option&gt;
    &lt;?}?&gt;
    &lt;/select&gt;
&lt;/div&gt;


I'd like to mention that keeping eclipses HTML code coloring would be a huge bonus...
Code separation

What you have there is everything mixed together - just by moving the php logic to the top of the file, makes it easier to read. With some minor reformatting it becomes easier to read/maintain:

&lt;?php
$states = getStates();
$statusList = getCxStatusList();
?&gt;  
&lt;div id="by_cx"&gt;
    &lt;!-- free text input for name --&gt;
    &lt;label&gt;Name:&lt;input type="text" id="cxByNameInput" name="cxByNameInput"/&gt;&lt;/label&gt;
    &lt;!-- cx state drop down --&gt;
    &lt;label for="cxState"&gt;State:&lt;/label&gt;
    &lt;select id="cxState"&gt;
        &lt;option&gt;&lt;/option&gt;
    &lt;?php while($state = $states-&gt;fetch_assoc()): ?&gt;
        &lt;option value="&lt;?= $state['st'] ?&gt;"&gt;&lt;?= $state['state'] ?&gt;&lt;/option&gt;
    &lt;?php endwhile; ?&gt;
    &lt;/select&gt;
    &lt;!-- cx status drop down --&gt;
    &lt;label for="cxStatus"&gt;Status&lt;/label&gt;
    &lt;select id="cxStatus"&gt;
        &lt;option&gt;&lt;/option&gt;
    &lt;?php while($status = $statusList-&gt;fetch_assoc()): ?&gt;
        &lt;option value="&lt;?= $status['cxType'] ?&gt;"&gt;&lt;?= $status['cxTypeDescription'] ?&gt;&lt;/option&gt;
    &lt;?php endwhile; ?&gt;
    &lt;/select&gt;
&lt;/div&gt;


Format for readability

If you're jumping in and out of php - having lines like this: {?&gt; make things hard to read, especially if there is some nesting in the code. Whether you choose to use curly braces or the alternate (colon) syntax is up to you, but in html code using a style which aides readability (putting the curly brace/colon on the same line as the statement it relates to) helps.

No PHP Short tags

Shorttags are often considered a bad practice, and as such should be avoided unless the code is your own, and you control where it's going to be used. Note that you can use &lt;?= with PHP 5.4 irrespective of the shorttags setting.

Consistent whitespace

The following:

&lt;? foo(); ?&gt;


Is easier to read than

&lt;?foo();?&gt;


Especially where it appears inline somewhere - use whitespace for readability.

Sprintf

If you find that your code gets to be like this:

&lt;foo x="&lt;?= $x ?&gt;" y="&lt;?= $y ?&gt;"  z="&lt;?= $z ?&gt;"&gt; ...


Then it's probably easier to read and maintain using:

&lt;?php echo sprintf('&lt;foo x="%s" y="%s" z="%s"&gt;...', $x, $y, $z); ?&gt;