[thelist] mysql table field - storing multiple values - solved

Renoir Boulanger renoirb at gmail.com
Fri Aug 24 05:42:16 CDT 2012


Indeed.

But json decode cam also return as an array. An object without being deserialized as in a class (instead of 'stdClass') is better.

json_decode($json, true);


A Sidenote about objects

Objects are nice to work with when you have the full declaration. Using public properties without visibility nor get/set--ers is like doing a big function in which you do many ifs.


Have a look at "phptherightway" this will give you todays best practices and details on 

--
Renoir Boulanger
http://renoirboulanger.com/

(envoyé de mon téléphone)
~

Em 2012-08-23, às 22:48, Bob Meetin <bobm at dottedi.biz> escreveu:

> JSON = ($row['extra_fields']); // the mysql query field
> $obj = json_decode($JSON);
> $f2 = $obj[1]->value;
> echo $f2;
> 
> Thank you both, this got me in the right direction. I then did a google on 'k2 decode json extra fields'. k2 is the joomla component employing this technique
> -- 
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt ! 


More information about the thelist mailing list