Sorry to ask this n00b question.
It's just my 2nd day in php.
I have this class database connection:
PHP Code:
<?php
class DBConnection{
private $link;
public function connect(){
include 'connstring.php';
$link = mysql_connect($host,$user,$pw);
if(!$link)
{
die('Could not connect'.mysql_error());
}
}
public function close()
{
mysql_close($link);
}
}
?>
But when I call connect and close function the errors come out.
Notice: Undefined variable: link in C:\Program Files\Apache Group\Apache2\htdocs\connection.php on line 16
Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in C:\Program Files\Apache Group\Apache2\htdocs\connection.php on line 16
why? 
edit: using do the trick.