If you were trying to use the result from mysql_pconnect() as the second
optional argument to mysql_query() in your function, be sure you declare
it 'global' inside the function.
Read PHP docs on "variable scope" if this is what tripped you up.
If not, I have no idea why the database is not selec
On Saturday 04 September 2004 03:42 pm, Torsten Roehr wrote:
> "Matthias Bauw" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
> > I'm having a problem with a php application;
> >
> > I have two files: one is ccadduser wich adds users to a controlcenter
> > that I am currently desig
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_c
huh I thought I tried that befoer and it didnt work but this time it worked
good, thanks everyone.
Also whats the difference between $globals['$variable'] and just global
-Lee
"Maxim Maletsky" <[EMAIL PROTECTED]> wrote in message
news:20021110082455.7C29.MAXIM@;php.net...
>
> you need to return
you need to return $db:
function db_conn($host,$user,$pass,$dab)
{
$db = mysql_connect("$host", "$user","$pass"
mysql_select_db("$dab",$db);
return $db;
}
and then use $db = db_conn(,,,);
or make it global:
function db_conn($host,$user,$pass,$dab)
{
blobal $db;
$db = mysql_connect("$host", "$
5 matches
Mail list logo