bezmond wrote:However, when I try to echo one of the variables within the acutal page, they are blank...

Within which page? The included page, or the calling page? Are they variables from the main program flow, or are they from within a function? Where are you trying to echo them -- from a function, or in the main program flow? Are they blank, or are they zero or false or null or just not set?

the variables are pulled from the database via the function which is stored in common.php. The function is called by the page "passport.php?id=x" - this page calls the function, then tries to echo the variables that the function retrieves from the database.

Ah. Just as I suspected. When you manipulate a variable inside a function (as you do with getpassportdetails()), the variables only exist within the scope of that function. They can only be accessed within that function, and once the function has finished executing, they're destroyed. The documentation on Variable scope is a good starting point to understanding this, but, as per usual, I'll give an example:

By the way, if you only want to get one row, you don't have to put the mysql_fetch_array in a loop. Also, it may be easier to just return the whole row, or declare the whole row as global, instead of individually doing it to each column.