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,

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

2007-03-28 Thread Onochie Anyanetu
Hi it would be helpful if you pasted to us the error u are getting. So instead of runquery($dbquery, $link_resource); use this: runquery($dbquery, $link_resource) or die(mysql_error()); which will echo out the error. On 3/28/07, Jvhcom <[EMAIL PROTECTED]> wrote: Hello Neil and Chris, Here are

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", 'ho

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 http://www.designmagick

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 th