Well

The situation is we are using mysql.We have written the queries and extracted the result from the assoc array.Now how do we access the result from javascript.

$query = "SELECT firstname FROM employees;
$result = mysql_query( $query , $resource );
$value= mysql_fetch_assoc( $result);
extract( $value );

Now does the javascript code be like
<script type="text/javascript">
function somefunction(){
var databasefield = document.getElementsByName("firstname").value;
}
</script>