Store query strings in a class
Posted: Mon Feb 15, 2010 10:20 am
Hello,
I am brand new to PHP with an ASP.Net background.
For a database driven application, I would like to save my query strings in a class.
I believe (!?) that the closest I came is shown below:
<?php
class EMail_Helper
{
var $Vets_Value = 'This will be the query...' ;
function Query_reports_to_email_vets()
{
return $this->Query_reports_to_email_vets=$Vets_Value;
}
}
?>
When instantiated, a call to the property return an empty string.
<?php // on instancie les classes
include('.....php');
$QueryHelper = new EMail_Helper();
echo $QueryHelper->Query_reports_to_email_vets();
?>
I would appreciate your support,
Michel
I am brand new to PHP with an ASP.Net background.
For a database driven application, I would like to save my query strings in a class.
I believe (!?) that the closest I came is shown below:
<?php
class EMail_Helper
{
var $Vets_Value = 'This will be the query...' ;
function Query_reports_to_email_vets()
{
return $this->Query_reports_to_email_vets=$Vets_Value;
}
}
?>
When instantiated, a call to the property return an empty string.
<?php // on instancie les classes
include('.....php');
$QueryHelper = new EMail_Helper();
echo $QueryHelper->Query_reports_to_email_vets();
?>
I would appreciate your support,
Michel