This is my code to get name list from the database but I am not able to get values where is the error can anyone pls help me
// database connection where php is my database name
<?php
$con=mysql_connect("localhost","root","root");
mysql_select_db("php",$con);
?>
// html body for getting value in option
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form method="post">
<select name="select" >
<option>Select College From Here</option>
<?php $getoptions = get_name(); ?>
<?php foreach ($getoptions as $key => $value) { ?>
<option><?= $value ?></option>
<?php } ?>
</select>
<input type="submit" name="sub">
</form>
// function to get name list from the database is this query right or wong ??
<?php
function get_name(){
$option=array();
$query="select * From login ";
$result=mysql_query($query);
while($row=mysql_fetch_array($result)){
$option [$row->id] = strtoupper($row->name);
}
$option;
}
?>
Help me regarding this that function not returning me the name from the table and m not able to see the list on select box.. and tell me how can i see the what function is going to return how to get function return value, can i alert the return value or echo the value