So i have this script, instead of having the output as what is in th script below, i would like to have it in a table i have had a couple of gos at this and failed......MISERABLY!!!. Could anyone help me out with an example. ps there are more fields to add but once i have an example i coulf figure it out from that maybe?<i have left out the top of the script for obviuos reasons> Thanx everydude!!
---------------------------------------------------------------------------------------
echo("<li>Can't connect to $HOST as $USER");
echo("<li>mysql Error: ".mysql_error());
die;
}
// select database
if (!mysql_select_db($DATABASE,$conn)) {
echo("<li>We were unable to select database $DATABASE");
die;
}
// if everything successful create query
// this selects all rows where the type is the one you chose in the dropdown
// * means that it will select all columns, ie name and type as i said above
echo "<table>";
$sql_query = "SELECT * FROM base_data WHERE ParishName LIKE '$chooser'";
// get the data from the database
$result = mysql_query($sql_query,$conn) or die('Invalid query: ' . mysql_error());
// output data
while ($details = mysql_fetch_array($result, MYSQL_ASSOC)) {
// print out the name
echo('Parish: '.$details['ParishName'].' - ');
// print out the type
echo('Owner Occupier Household: '.$details['OwnerOccupierHousehold'].'<br>');
}
// close mysql connection
mysql_close($conn);
}
?>