Functions not found when included in an 'include' file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gregambrose
Forum Newbie
Posts: 12
Joined: Thu Aug 07, 2003 11:01 pm
Location: Sydney, Australia

Functions not found when included in an 'include' file

Post by gregambrose »

I have defined a function which works fine when a part of the same source file as the one calling it. When I move it to a separate file I get the message "Call to undefined function".

The program is finding the include file (if I rename it it complains).

The include function is as follows :-

Code: Select all

<php?	

function uopendb($host, $user, $password, $db)
&#123;

	mysql_connect($host, $user, $password);	
	
	mysql_select_db($db);
	

	hhhlll;  // this is an intensional error which doesnt get reported
&#125;

?>
gregambrose
Forum Newbie
Posts: 12
Joined: Thu Aug 07, 2003 11:01 pm
Location: Sydney, Australia

Post by gregambrose »

OK. I haven't been writing PHP very long. I got the tag on line 1 wrong. How fundermental an error is that.

I hope I haven't wasted anyone's time.
Post Reply