Extracting a variable from a class-function

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

How do you extract $sec from $now?

I have tried:

$aaa = $now;


$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?