That error comes because of there is a spelling error on the variablename and the query is not getting the id.
function get_leadactor($leadactor_id) {
..then later you use $leadacor_id in the query.
I hope this is not straight from the book as the 2 first functions are identical(same query, same return, just function name and variable name changes). You could easily combine that to more general one for example:
function get_person($id = FALSE)
{
if (!$id)
{
return FALSE;
}
$query = 'SELECT people_fullname FROM people WHERE people_id = '.$id;
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_assoc($result);
return $row['people_fullname'];
}
BTW, youi dont have to use global $db. Mysql will work inside functions if the connection is open. Also that extract function was just an extra that you wont need as you can return the exact field name inside the row as in my example.