|
Posted by nephish on 08/09/06 13:36
Jerry Stuckle wrote:
> nephish wrote:
> > Jerry Stuckle wrote:
> >
> >>nephish wrote:
> >>
> >>>Jerry Stuckle wrote:
> >>>
> >>>
> >>>>nephish wrote:
> >>>>
> >>>>
> >>>>>Ok, well what i have been doing is creating session variables for
> >>>>>everything possible that relates to what one may call an object (not in
> >>>>>the code, but at the site)
> >>>>>like $name = $_SESSION['name'];
> >>>>>$email = $_SESSION['email'];
> >>>>>$phone = yadda, yadda, yadda
> >>>>>
> >>>>>so, i suppose this is still the easier way to pull this off.
> >>>>>thanks for all the info, i am trying to learn as much as possible
> >>>>>because i want to redesign everything in the fall. i started learning
> >>>>>php about a year ago, and a whole lot of stuff i did last Fall, i would
> >>>>>do differently this Fall.
> >>>>>So i want to make it as streamlined as possible.
> >>>>>
> >>>>>thanks for all your help
> >>>>>
> >>>>>shawn
> >>>>>
> >>>>>
> >>>>
> >>>>How I typically do it (since I have my data in a database) is to store
> >>>>the primary key to the entry in my $_SESSION object. Then I fetch
> >>>>whatever I need from the database when I need it.
> >>>>
> >>>>I find this to be much cleaner code. It also fetches current
> >>>>information in the (admittedly unlikely) event the data is changed while
> >>>>you're passing it around.
> >>>>
> >>>>P.S. Please don't top post. This newsgroup uses bottom (or inline)
> >>>>posting as the standard.
> >>>>
> >>>>--
> >>>>==================
> >>>>Remove the "x" from my email address
> >>>>Jerry Stuckle
> >>>>JDS Computer Training Corp.
> >>>>jstucklex@attglobal.net
> >>>>==================
> >>>
> >>>
> >>>by bottom post, you mean write my stuff at the bottom of the text entry
> >>>box ?
> >>>like this ? Sorry about that. I have kinda wondered which is better.
> >>>
> >>
> >>Yep, or intermingled, like this. Thanks.
> >>
> >>
> >>
> >>>Anyway. I like that idea too. just storing the session variable of the
> >>>primary key.
> >>>in my case (user_id_number), and just using that to conquer everything
> >>>else.
> >>>
> >>>OK, i have another question about this re-write i want to do. Please
> >>>understand, i started learning php about 10 months ago by building our
> >>>huge website with it. couple of hundered scripts now.
> >>>
> >>>there is a lot i find on the web about MVC. But also found that it
> >>>seems to be best for simple CRUD. What we have here is a lot more
> >>>complex. We are pulling machine data, processing it, displaying graphs
> >>>of machine effeciency, history of machine performance, etc.. Once
> >>>things get complex like that, not like a blog site or something, does
> >>>an MVC still make sense ?
> >>>
> >>>thanks.
> >>>
> >>>sk
> >>>
> >>
> >>Probably, but I don't use packages. I typically define my own class
> >>hierarchy. With a little practice and some templates I created, it
> >>doesn't take me long.
> >>
> >>One set of classes to interface to the database, then one on top of that
> >>for the business logic.
> >>
> >>
> >>--
> >>==================
> >>Remove the "x" from my email address
> >>Jerry Stuckle
> >>JDS Computer Training Corp.
> >>jstucklex@attglobal.net
> >>==================
> >
> >
> > now, i had thought of that, because what we are doing is as far from
> > Drupal as one can imagine. I just thought it might be easier to try to
> > customize something else. I kinda don't get along with PEAR for db
> > stuff, but i like it for mail. i suppose i can write my own templates.
> > At least i would know how it works.
> >
> > thanks
> >
>
> I don't use PEAR, either. Just the mysqli classes on PHP 5 (before I
> used the mysql interface).
>
> I have a generic database class template and a table template I can
> easily modify. One of these days I'll write a little code to fetch the
> columns in the table and gen the entire class. But I never bothered
> because it only takes a few minutes to gen the entire class by hand.
> Then I modify it for table-specific stuff and I'm done.
>
> The whole thing goes pretty quickly.
>
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstucklex@attglobal.net
> ==================
Thats what i had in mind, i need desperately to clean up how all my
stuff works now,
but i could make a class that defines a customer, or a customers
machine, and populate it on the fly from an sql look-up, and keep it
constant throuout. Thats my main mess now, as i learned new stuff, the
site is less and less consistant.
Thanks for your help and advise.
shawn
[Back to original message]
|