Finally taking the time to mess with php classes, and curious to know if something like the following is the most efficient way to repeatedly use mysql results:
class ProjectDetails {
private $ProjectDetails;
function getDetails($projectid) {
$query_GetDetails =
"SELECT * FROM projects WHERE ProjectID = $projectid";
$results_ProjectDetails = mysql_query($query_GetDetails);
$ProjectDetails = mysql_fetch_array($results_ProjectDetails);
$this->ProjectDetails = $ProjectDetails;
}
function getDetail($el) {
$this->ProjectDetails[$el];
}
}
While reading up on the topic, I found some people would call their query function in each of their desired result functions, which in my case would be calling GetDetails() within GetDetail(), just to have access to that returned array. Am I correct in assuming the above posted method is more efficient? And also, is there a better way to do this?
Thanks as always,