query()到非对象

Im trying to do an update to this order form but i get this error "Fatal error: Call to a member function query() on a non-object". HELP!

define('DB_NAME', 'sueng2_mp');
define('DB_USER', 'sueng2_jonathon');
define('DB_PASSWORD', 'jonathon');
define('DB_HOST', 'localhost');

$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);

if (!$link) {
    die('Could not connect: ' . mysql_error());
}

$db_selected = mysql_select_db(DB_NAME, $link);

if (!$db_selected) {
    die('Can\'t use ' . DB_NAME . ': ' . mysql_error());
}`


$update = "UPDATE J_USERS 
SET patient = '$value', year = '$value4', gender = '$value5', age = '$value6', height = '$value7', weight = '$value8', foot_length = '$value9', sheight = '$value10', Amputation = '$value11' 
WHERE user_login = '" . $user . "'";

$link->query($update);

replace

$link->query($update);

with

mysql_query($update, $link);

because $link is a Mysql link identifier, it have no any methods. use http://php.net/manual/en/function.mysql-query.php instead. and yea.. its deprecated