I am writing a program where I repeat this code on numerous pages:
PHP Code:
$shipping_query=("SELECT * FROM `shipping` WHERE `mra_number`='$mra_number'");
$shipping_result mysql_query($shipping_query);
$ship=mysql_fetch_array($shipping_result)) {

I would like to turn this into a function that I can just include. This is what I wrote and it doesn't seem to be working:
PHP Code:
function shipQuery($mra_num) {
$shipping_query=mysql_query("SELECT * FROM shipping WHERE mra_number='$mra_num'");
$ship=mysql_fetch_array($shipping_query)) {
$ship['fname'] = $c_fname;
$ship['lname'] = $c_lname;
$ship['company'] = $c_company;
$ship['distributor'] = $c_distributor;
$ship['email'] = $c_email;
$ship['phone'] = $c_phone;
$ship['address1'] = $c_address1;
$ship['address2'] = $c_address2;
$ship['city'] = $c_city;
$ship['state'] = $c_state;
$ship['zip'] = $c_zip;
$ship['country'] = $c_country;

If I try and echo $c_fname, the screen is blank. Any ideas?