function get_record_info() { // Use the global keyword to let this function // access variables that have web-page scope. // global $dbname, $id_link, $table_name, $arr_request; // Declare some variables as global so information // can be easily passed from this function to // the web page. // global $key, $str_month_name; $key = $arr_request['key']; $str_sql = " select * from $table_name where key_$table_name = $key "; $result = mysql_db_query($dbname, $str_sql, $id_link); if (! $result) { affy_error_exit('SQL Select Execution failed.'); } // Turn the record into an object. $record = @mysql_fetch_object($result); // Set the global variable so it can be // used by the web page. $str_month_name = $record->str_month_name; }