At 08:16 10.11.2002, conbud said:
--------------------[snip]--------------------
>also I have the function wrong in my original question I have it as
>function db_conn($host,$user,$pass,$dab)
>{
>$db = mysql_connect("$host", "$user","$pass"
>mysql_select_db("$dab",$db);
>}
>
>and not
>function db_conn($host,$user,$pass,$dab)
>{
>$db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db);
>}
--------------------[snip]-------------------- 

mysql_select_db already opens a connection to the database; you don't need
the mysql_connect() call afterwards.

In your code you have mysql_select_db() as fourth parameter to
mysql_connect(). While the fourth parameter is boolean and won't generate
any error at runtime, it's use- and senseless. The 4th parameter on
mysql_connect specifies if PHP should use an existing link, or create a new
one.

You should decide whether you want to go with mysql_select_db() or
mysql_connect().


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



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

Reply via email to