okay, sounds simple. basically, let's say since your including files, we'll set it up like this:
page one, is page we're on
function.php is the file were calling:
first, make sure your connected to the database:
include ('connect.php') //- you know just make a quick connection file to include as well.
// function.php -- were in the file being called now
function getinfo(){
global $variables, $whatever, $youwant;
$query=mysql_query("select * from table");
$amount=mysql_num_rows($query);
let's say your displaying a re-occuring informatino table, like a user's list:
for ($i=0; $i<$amount; $i++){
$name=mysql_result($query, $i, 'name');
$email=mysql_result($query, $i, 'email);
echo $name;
echo $email;
}
}
or you just want to display once:
$name=mysql_result($query, 0, 'name);
$email=mysql_result($query,0,'email');
at which point $amount will not be needed.
//pageone.php
<?php
include ('connect.php');
include ('funciton.php');
?>
hope that helps, let me know if you need anythign else.