There's nothing wrong with this approach. However, make sure to not only say:
<?
...
db_kapcs() ;
...
?>
But also:
<?
require ("yourincludefile");
db_kapcs() ;
...
?>
Undefined function means it cannot find the function db_kapcs() {}.
This can be because:
- You didn't require the file before calling the function
- You put the required file in a different path and it can't be included
- You made a typing mistake, either in calling the function, or in creating the function (or in the required part)
You could make $db global, however I don't really believe this is needed.
Also I take it with:
$dbhost = MYHOSTNAME ;
You mean:
$dbhost = "myhostname";
(just to be sure)
Also, mind the case sensitivity, eg.:
$login = "AKOS";
is different from:
$login = "akos";
Hope this helps...