Re: [PHP-DB] problems with functions/included files/mysql resource

2007-03-28 Thread Jvhcom
Hello Neil and Chris, Here are the database-related functions that reside in their own separate file: function connecttodatabase() { global $link_resource; if(!($link_resource=mysql_connect('host', 'user_name', 'password'))) { printf(Error connecting to host %s, by user %s,

Re: [PHP-DB] problems with functions/included files/mysql resource

2007-03-28 Thread Chris
Jvhcom wrote: Hello Neil and Chris, Here are the database-related functions that reside in their own separate file: function connecttodatabase() { global $link_resource; if(!($link_resource=mysql_connect('host', 'user_name', 'password'))) { printf(Error connecting to host %s,

[PHP-DB] problems with functions/included files/mysql resource

2007-03-27 Thread Jvhcom
Hello Everyone, I am new to this or any news group. The end of this story is that I believe I am calling a function from within a function in a way that I should not be, but I cannot figure out exactly what part I am doing incorrectly. I have the following main file with other content included

Re: [PHP-DB] problems with functions/included files/mysql resource

2007-03-27 Thread Niel Archer
Hi, In the function to connect to and select the database, I make the mysql-link resource a global value. It sounds like you've misunderstood 'global' variable. The global statement needs to go inside the function where you want to use the variable, not where you assign it. This tells that

Re: [PHP-DB] problems with functions/included files/mysql resource

2007-03-27 Thread Chris
In the function to connect to and select the database, I make the mysql-link resource a global value. How are you doing that? Code please :) Obviously change the password etc.. And how are you referencing it in the other files/functions? -- Postgresql php tutorials