Alain,

Ok, I aplogize, for I neglected to notice that you were not passing back the db connection $link variable from your openDB function, so here is what you are going to want to do.

page connectie.php

Function openDB()
{
 $link = mysql_connect("localhost", "host", "pas")

       or die("geen connectie mogelijk : " . mysql_error());
   print "connectie ok";
   mysql_select_db("database") or die("geen database gevonden");
   return $link;
}

Function closeDB($ref_link)
{
        mysql_close($ref_link);
}


include ('connectie.php');


//open connectie

$connectie = openDB();

//code

//close connectie
closeDB($connectie);




Jordan S. Jones


alain dhaene wrote:


I have try
but I get the following error:


Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /home/schoolre/public_html/Hitek/Online/connectie.php on line 16

Alain


"Jordan S. Jones" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]


Alain,

You can pass it in the function as a variable.

E.g...

Function closeDB($ref_link)
{
         mysql_close($ref_link);
}


closeDB($connectie);


Hope this Helps,

Jordan S. Jones

--

I am nothing but a poor boy. Please Donate..



https://www.paypal.com/xclick/business=list%40racistnames.com&item_name=Jord
an+S.+Jones&no_note=1&tax=0&currency_code=USD




-- I am nothing but a poor boy. Please Donate.. https://www.paypal.com/xclick/business=list%40racistnames.com&item_name=Jordan+S.+Jones&no_note=1&tax=0&currency_code=USD

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to