note 82578 deleted from functions.variable-functions by felipe
| From: | felipe@php.net | Date: | Thu, 17 Apr 2008 10:40:40 +0000 |
| Subject: | note 82578 deleted from functions.variable-functions by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-138399@lists.php.net to get a copy of this message | ||
Note Submitter: sandovalpaolo at gmail dot com
----
//function to connect to a database
function connect($localhost, $root, $password, $ddbb)
{
$host = $localhost;
$user = $root;
$code = $password;
$dbname = $ddbb;
if (!$net = mysql_connect($host, $user, $code)) {
echo "could't connect to $host";
exit;
}
mysql_select_db($dbname);
}
// call de function first example
connect("localhost", "user", "code", $page);
// second example
connect("localhost", "user","","");