Friday 06 February 2004 7:52:07 am
I think that, in most cases, you'll have to do something special to make this happen. There are many ways to do this, but I'll give you an example of one. Let's say, for instance, that you wanted a "Car" datatype. This data type would have 3 attributes, Year, Make, and Model. There are two ways, I can see, to do this. Either way, you'll need to create a new datatype in PHP, so get your programming skills ready. The first way, is to create a table in the database. In "data_int" you'll store the ID of the record in the database that holds the information you've stored. Your datatype object, in this case, will be responsible for pulling that data out and putting it back in. I believe ezURL does it this way. A second, easier method, would be to use PHP's serialize function. Build an array of your items like so.... $blah = array('year' => '2003', 'make' => "Saturn", 'model' => 'ION3'); The serialize it.. .like so $ser = serialize($blah); Then store the value of $ser in data_text. I'm not sure how the internals of DataTypes work just yet, as I haven't gotten to that part of the learning process yet. But, when I do, I can post an actual PHP code example of this datatype.
|