southbeach
Programmer
Howdy!
I have decided to write a couple of classes where I can reference tables dynamically and have variables set dynamically based on name of columns (not sure how good of an idea this is - lol).
I recently started using Linux NetBean IDE and it suggests that I keep my methods to no more than 20 lines - never heard this but I'll take it at face value and so, I'm trying to shrink my code as much as possible (and a bit of change of style + laziness).
So, with this approach, I should be able to set any number of
Here is a snippet of what I have when loading a row
I want to do same in job() to set all possible $this->[name] to blank ...
Thank you all in advance for your assistance!
PS: I feel that I am asking is very simple question in a very complicated way!
--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
I have decided to write a couple of classes where I can reference tables dynamically and have variables set dynamically based on name of columns (not sure how good of an idea this is - lol).
I recently started using Linux NetBean IDE and it suggests that I keep my methods to no more than 20 lines - never heard this but I'll take it at face value and so, I'm trying to shrink my code as much as possible (and a bit of change of style + laziness).
So, with this approach, I should be able to set any number of
Code:
$this->$query[$key]='some value'
NOTE: where $query[$key] represents the column's name as queried or read!
Here is a snippet of what I have when loading a row
Code:
if ($query) {
$job = mysqli_fetch_assoc($query);
foreach ($job as $key=>$value) {
$this->$key=$value;
}
} else { $this->job(); }
I want to do same in job() to set all possible $this->[name] to blank ...
Thank you all in advance for your assistance!
PS: I feel that I am asking is very simple question in a very complicated way!
--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.