Fatal error: Call to a member function update() on a non-object in my resturant plugin file restaurants.php

Put the $gldb connection right after $wpdb, like this:

$wpdb = new wpdb( 'gls_wp874', '8nS83Pu4cy', 'gls_wp874', 'localhost' );
$gldb = new wpdb( 'gl_wpdb12', 'n7dmSl8h4P', 'gl_wpdb12', 'localhost' );

You can’t use connection that has not been made…