This is my code :
<?php
require_once 'classes/dbconnect.php';
$connector = new dbconnect();
pp();
function pp(){
$uid="0000007";
$table = $connector->query("SELECT * FROM tc_personal WHERE uid = '$uid'");
$tb = mysql_fetch_object($table);
print $tb->name;
}
?>
but this code will not work because the pp() function can't access the $connector. How can i define a global variable as $connector?