What's new
HTML Forums | An HTML and CSS Coding Community

Welcome to HTMLForums; home of web development discussion! Please sign in or register your free account to get involved. Once registered you will be able to connect with other members, send and receive private messages, reply to topics and create your very own. Our registration process is hassle-free and takes no time at all!

Drop-down from XML File

Yitzchak

New member
Hi all,
I've got a drop-down field which gets populated from data of a MSQL table.
The problem is that the list is over 12,000 records big, so the drop-down takes
really long to load.
Would it be faster if I based the drop-down from a XML file that is located in
the same directory where the php (with the drop-down code) is located?

If so - could someone help with code to populate the drop-down please?
I'm very new to Web development and learn most things from Google :)

This is the stripped-out code I'm using at the moment:

The PHP part:
<?php
$ProvincesLU = mysqli_query($mysqli, "SELECT * FROM LookupList WHERE Province <> ''");
while($Row = mysqli_fetch_array($ProvincesLU)) { $ProvinceOptions = $ProvinceOptions."<option>$Row[1]</option>"; }
?>

The HTML part:
<html>
<head>
<title>Contact Details</title>
</head>
<body>
<form name="form1" method="post" action="">
<tr>
<td>Province</td>
<td>
<select disabled name="SProvince" <?php echo $SProvince;?>>
<option value='<?php echo $SProvince;?>'><selected="selected"><?php echo $SProvince;?></option>
<?php echo $ProvinceOptions;?>
</select>
</td>
</tr>
</body>
</html>
 
Back
Top