• Can somebody help me, how can I process this in wordpress as php/html.
    I put this as is, returning empty in ‘select’ section.
    Thanks,

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    <?php
    mysql_connect("localhost", "root", "password") or die("Connection Failed");
    mysql_select_db("company")or die("Connection Failed");
    $query = "SELECT * FROM COMPANIES order by COMPANYNAME";
    $result = mysql_query($query);
    ?> 
    
    <select name='company'>
    <option value="">Select</option>
    
    <?php while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { ?>
    <option value="<?php echo $line['COMPANYNAME'];?>"> <?php echo $line['COMPANYNAME'];?> </option>   <?php } ?> 
    
    </select>

The topic ‘php / html code process’ is closed to new replies.