Re: [PHP] Re: function problem

2005-01-03 Thread Richard Lynch
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

Re: [PHP] Re: function problem

2004-09-04 Thread Andre Dubuc
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

Re: [PHP] Re: Function Problem

2002-11-10 Thread Ernest E Vogelsinger
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

Re: [PHP] Re: Function Problem

2002-11-09 Thread conbud
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

Re: [PHP] Re: Function Problem

2002-11-09 Thread Maxim Maletsky
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", "$