Re: mysql to postgres migration blues...

From: Date: Thu, 23 Sep 2004 20:32:45 +0000
Subject: Re: mysql to postgres migration blues...
References: 1 2 3 4 5  Groups: php.db 
Request: Send a blank email to php-db+get-36368@lists.php.net to get a copy of this message
On Thu, 23 Sep 2004 12:23:32 -0700, Andrew Kreps <andrew.kreps@gmail.com> wrote: > On Thu, 23 Sep 2004 20:51:52 +0200, Antoine <melser.anton@gmail.com> wrote: > > declaring it as global didn't seem to work - > > > > global $link; > > /* Connect to database */ > > $link = pg_connect("dbname=movies host=localhost user=anton > > password=password") > > The global keyword works a little bit differently in PHP. You need to > inform your function that your variable is global, as opposed to > declaring it as global outside the function. Like: > > $link = "database connection" > > function processData () { > global $link; > ... Like i said, I'll get there ;-). Cheers! I hope you folks don't mind answering some rather basic questions... I am going to be starting some serious development soon and promise to search the docs first :-). I have just followed up on the suggestion of pear and it looks like a winner. That may mean a change of mailing list but all good for the moment. Cheers Antoine -- G System, The Evolving GUniverse - http://www.g-system.at

« previous php.db (#36368) next »