I am having trouble calling external functions. I am trying to use this to clean up the code in the display. I have this as the function.php
<?php
function connect() {
global $link;
$link = mysql_connect("localhost","username","password")
or die ("Could not Connect to DB");
mysql_select_db("database",$link) or die (mysql_error());
}function links() {
global $link;
$sql = "select * from jozef_links";
$result = mysql_query($sql, $link) or die (mysql_error());
echo "<li>";
while ($array = mysql_fetch_array($result)) {
$id = $array['link_name'];
$url= $array['link_url'];
echo "<ul><a href=\"$url\">$id</a></ul>\n";
}
echo "</li>";
}
?>and am trying to use it in this links3.php
<?php
include('functions.php') or die (mysql_error());
?>but I keep getting the error message
*Warning*: main(1): failed to open stream: No such file or directory in *C:\Accounts\dbadream\wwwRoot\links3.php* on line *4*
*Warning*: main(): Failed opening '1' for inclusion (include_path='.;c:\php4\pear') in *C:\Accounts\dbadream\wwwRoot\links3.php* on line *4*
Can anyone explain what is wrong. Both files are in the same directory and and both have the normal permissions set to access.
Thanks,
jzf
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
