Extracting a variable from a class-function

class updating {
	function update() {
		$aaa = rand(0,10000000);
		$conn = mysql_connect('localhost', 'user', 'pass');
		mysql_select_db('database1');
		$sqls = "UPDATE `table1` SET column1='$aaa'";
		$results = mysql_query($sqls, $conn);
		mysql_close($conn);
		return $aaa;
	}
}
$now = new updating;
$now->update();

How do you extract $sec from $now?

I have tried:

$aaa = $now;

and

$aaa = update();

I need $aaa to continue with my programming.

You’re returning the variable from the function, so just

$aaa = $now->update();

should do it.

But honestly this is a horrible object design. What exactly are you trying to do?