You could either put that code before you put it into the database, or after you retrieve it from the database. To do the former, it would look something like this:
$text = preg_replace("/(http:\/\/){0,1}www.(([0-9a-zA-Z\/:]+).)+(([0-9a-zA-Z\/:]+))/", "<a href=\"http://\0\" \">\0</a>", $text);
$query = "INSERT INTO scholarship (schol_id, schol_name, value, deadline, app_info, agency_name, eligibility, field, level) values (nextval('scholarship_schol_id_seq'), '$name', '$value', '$deadline', '$app_info', '$agency', '$eligibility', '$field', '$level')";
Then when you insert the data, the $text variable will have hyperlink code added to it. Does that answer your question?