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,
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,
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
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
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