This topic is locked

PHP error in generated app

7/17/2005 8:01:46 AM
PHPRunner General questions
jpedwardspost author

Hi,
bit of a problem -

my generated App works fine on my home computer but when I upload it to the web and run it I get:
Warning: Division by zero in ...../unacdb/d2/include/un_prop_list_functions.php on line 884 Warning: Cannot modify header information - headers already sent by (output started at ...../unacdb/d2/include/un_prop_list_functions.php:884) in ...../unacdb/d2/include/dbcommon.php on line 15
This is a bit odd because I generated another bit of this app which sits in another directory on the webserver
(...../unacdb/d1/) and this works just fine.
Any suggestions greatly appreciated.
Cheers,

JP
Other Info:
Locally I have MySQL 4.1.11 and PHP 4.3.11 whereas

my webhost has MySQL 3.23.56 and PHP 4.3.10
I looked up line 884 in un_prop_list_functions.php and it is the last line of the following function:
// returns field's default value

function GetDefaultValue($field)

{

global $strTableName;

if($field=="property_id") return "";

if($field=="num_name") return "";

if($field=="street") return "";

if($field=="area") return "";

if($field=="city") return "";

if($field=="country") return "";

if($field=="postcode") return "";

if($field=="wap_addr") return "";

if($field=="owner_id") return @$_SESSION[$strTableName."_masterkey"];

if($field=="rent") return "";

if($field=="rent_period_id") return "";

if($field=="rent_unit") return "";

if($field=="rent_allinone") return "";

if($field=="wap_rent_allinone") return "";

if($field=="sretainer") return "";

if($field=="sretainer_rent") return "";

if($field=="sretainer_period_id") return "";

if($field=="sretainer_unit") return "";

if($field=="sretainer_allinone") return "";

if($field=="wap_sretainer_allinone") return "";

if($field=="take_singles") return "";

if($field=="take_couples") return "";

if($field=="take_groups") return "";

if($field=="take_working") return "";

if($field=="bedrooms") return "";

if($field=="double_bedrooms") return "";

if($field=="single_bedrooms") return "";

if($field=="ensuite_bedrooms") return "";

if($field=="bathrooms") return "";

if($field=="kitchens") return "";

if($field=="prop_condition") return "";

if($field=="prop_type_id") return "";

if($field=="title_desc") return "";

if($field=="wap_title_desc") return "";

if($field=="bullet1") return "";

if($field=="bullet2") return "";

if($field=="bullet3") return "";

if($field=="bullet4") return "";

if($field=="bullet5") return "";

if($field=="bullet6") return "";

if($field=="bullet7") return "";

if($field=="bullet8") return "";

if($field=="contract_start") return 01/09/2005;

if($field=="contract_end") return 30/06/2006;

if($field=="available_from") return 01/07/2005;

if($field=="unavailable_from") return "";

if($field=="active") return "";

if($field=="deactivate_on") return "";

if($field=="loaded_by") return now();

if($field=="loaded_date") return "";

if($field=="picture_link") return "";

if($field=="pdf_link") return "";

if($field=="hold_keys") return "";
return $_SESSION[$strTableName."_fieldinfo"][$field]["default"];

}

jpedwardspost author 7/17/2005

Hi

After doing a bit of digging I have added the line

PHP_FLAG output_buffering on

to my htaccess file and now the error message has been reduced to:
Warning: Division by zero in ...../unacdb/d2/include/un_prop_list_functions.php on line 884
Cheers,

JP

Sergey Kornilov admin 7/18/2005

Hi,
the problem is caused by default values you entered for

contract_start, contract_end and available_from fields.

Default Date values should be specified in "YYYY-MM-DD" format and should be quoted.
So click on Edit formaton Formatting tab in PHPRunner and change default value from 01/09/2005 to "2005-09-01"

jpedwardspost author 7/18/2005

Thanks,
Your fix worked fine. I also was able to remove the additional line I had put in the htaccess file.
Cheers,

JP