Fetch a single row from a custom table for to a given ID

$wpdb->wp_philosophy_philosopher won’t work here because it has not been defined. $wpdb->table_name works only with default tables.

You can create your own using:

$wpdb->philosophy_philosopher = $wpdb->prefix . "philosophy_philosopher"; 

Note that the wp_ is just the table prefix and has been omitted here because different installations can have different prefixes and that your code stop to work if you change your table prefix.

You can update your code to:

function gettingonly($phl) {

  global $wpdb;
  $wpdb->philosophy_philosopher = $wpdb->prefix . "philosophy_philosopher"; 
  $mylink = $wpdb->get_row("SELECT * FROM $wpdb->philosophy_philosopher WHERE philosopher=%s",$phl);
  #the rest of your code
}

Also, learn to prepare your statements.

error code: 523