Error on page

Hi. I have created a small form with a radio button, textbox and a list on it. When I click on the radio button I want the list to be populated with some records from a database. I do not know what is the problem with my code and I hope someone can help me. I AM VERY NEW WITH PHP.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>



function LoadBuildings(){
$strSQL = "SELECT internalCodeBuilding FROM building";
$result=mysql_query($strSQL) or die("Unable to select the information!");
echo'<select name="lstBuilding"><option value=""></option>';

echo '<option value='.$rand['internalCodeBuilding'].'</option>';

echo '
<table width="80%" border="1">
        <input type="radio" name="RadioGroup1" value="building" id="RadioGroup1_0" onclick="LoadBuildings()";/>
      <br />
    <td>Building name: 
      <input type="text" name="txtBuildingName" id="txtBuildingName" />
    <td>Select building: 
      <select name="lstBuilding" id="lstBuilding">


Thank you.

Hi. How do I integrate JS in my code? Thx.

Firstly the onclick event is reserved for JS functions only, the only way you can get records is to either pre-load them on the page and add unique ID’s to them so you can append them to the list or use Ajax which would be better