How to call a function from within another function


#1

Everything is working except the save_info() function called from the load_info function not saving to the database.

// This function will save information to an existing account
//==MAN8==
function save_info($dbh, $table, $pname, $pip, $pnp, $pop, $psp)
{
try
	{
		$stmt = $dbh->prepare("UPDATE $table SET p_ip=?, p_np=?,p_op=?,p_sp=? WHERE p_name=?");
		$stmt->execute(array($pip,$pnp,$pop,$psp,$pname));
		echo "1";
	}
	catch (PDOExecption $ex)
		{	
			echo "0";
		}
	$dbh = null;
}

// This function will pull account information
//==MAN9==
function load_info($dbh,$table,$pname)
{
	{
		$stmt = $dbh->query("SELECT * FROM $table WHERE p_name = '$pname'");
		$result = $stmt->fetchObject();
		
		if ($result->p_ip > $result->p_np)
		{
		echo 'yes';
		}
	    if ($result->p_ip = $result->p_np)
		{
		save_info($dbh, $table, $pname, $pip, $pnp, $pop, $psp);	
		}	
	}

#2

Looks like those values are missing?