Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

Retrieve mysql field and put it in array() in PHP

Codes here !

Moderators: macek, egami, gesf

Retrieve mysql field and put it in array() in PHP

Postby YankeeDoodle » Tue May 20, 2014 4:16 am

Hi, I am new here ( :help: ). In my MySql DB I have a row called "template_styles" (Joomla 2.5 with Rockettheme template)
One field in the row is called "params", and contains a lot of parameters to generate the right template style. I want to be able (with a PHP script) to load those parameters into an array().
How do I code that in PHP?
Thanks in advance for the help ! :D
===============================================================================
Here is what the contents of the field look like:
===============================================================================
{"master":"true","current_id":"7","template_full_name":"Lumiere","grid_system":"12","template_prefix":"lumiere-","cookie_time":"31536000","override_set":"2.5","name":"Preset1","copy_lang_files_if_diff":"1","logo":{"enabled":"1","position":"header-a","type":"lumiere","custom":{"image":""}},"main":{"accent":"#A84D6C","body":"light"},"background":{"enabled":"1","position":"background","type":"bgimage","bgvideo":{"video":{"file":"Rouven_copyrightdownloopscom","poster":"Rouven_copyrightdownloopscom.jpg","loop":"1","pause":"0","mute":"0","mobile":"0"}},"bgimage":{"image":{"option":"1","template":"rouven","custom":""}}},"font":{"family":"s:lumiere","size":"default","size-is":"default"},"viewswitcher-priority":"1","logo-priority":"2","copyright-priority":"3","styledeclaration-priority":"4","fontsizer-priority":"5","date-priority":"7","totop-priority":"8","systemmessages-priority":"9","morearticles-priority":"12","smartload-priority":"13","pagesuffix-priority":"14","resetsettings-priority":"15","analytics-priority":"16","dropdownmenu-priority":"18","jstools-priority":"21","moduleoverlays-priority":"22","rtl-priority":"23","splitmenu-priority":"24","webfonts-priority":"27","styledeclaration-enabled":"1","social":{"enabled":"0","position":"copyright-c","twitter":"","facebook":"","google":"","rss":""},"date":{"enabled":"0","position":"top-d","clientside":"0","formats":"%A, %B %d, %Y"},"fontsizer":{"enabled":"0","position":"feature-b"},"login":{"enabled":"0","position":"utility-c","text":"Member Login","logouttext":"Logout"},"popup":{"enabled":"0","position":"utility-d","text":"Popup Module","width":"250","height":"235"},"branding":{"enabled":"0","position":"copyright-a"},"copyright":{"enabled":"0","position":"debug","text":"Designed by RocketTheme","layout":"3,3,3,3","showall":"0","showmax":"6"},"totop":{"enabled":"0","position":"copyright-c"},"systemmessages":{"enabled":"1","position":"drawer"},"resetsettings":{"enabled":"0","position":"copyright-d","text":"Reset Settings"},"analytics":{"enabled":"0","code":"","position":"analytics"},"menu":{"enabled":"1","type":"dropdownmenu","dropdownmenu":{"theme":"gantry-dropdown","limit_levels":"0","startLevel":"0","showAllChildren":"1","class_sfx":"top","cache":"0","menutype":"mainmenu","position":"header-b","responsive-menu":"panel","enable-current-id":"0","module_cache":"1"},"splitmenu":{"mainmenu-limit_levels":"1","mainmenu-startLevel":"0","mainmenu-endLevel":"0","mainmenu-class_sfx":"top","submenu-limit_levels":"1","submenu-startLevel":"1","submenu-endLevel":"9","cache":"0","menutype":"mainmenu","theme":"gantry-splitmenu","mainmenu-position":"header-b","submenu-position":"sidebar-a","submenu-title":"1","submenu-class_sfx":"","submenu-module_sfx":"box3 title2","responsive-menu":"panel","roknavmenu_dropdown_enable-current-id":"0","module_cache":"1"}},"top":{"layout":"3,3,3,3","showall":"0","showmax":"6"},"header":{"layout":"a:1:{i:12;a:1:{i:2;a:2:{i:0;i:4;i:1;i:8;}}}","showall":"0","showmax":"6"},"showcase":{"layout":"3,3,3,3","showall":"0","showmax":"6"},"feature":{"layout":"3,3,3,3","showall":"0","showmax":"6"},"utility":{"layout":"3,3,3,3","showall":"0","showmax":"6"},"maintop":{"layout":"3,3,3,3","showall":"0","showmax":"6"},"mainbodyPosition":"a:1:{i:12;a:2:{i:3;a:3:{s:2:\"sa\";i:3;s:2:\"mb\";i:6;s:2:\"sb\";i:3;}i:2;a:2:{s:2:\"sa\";i:3;s:2:\"mb\";i:9;}}}","mainbottom":{"layout":"3,3,3,3","showall":"0","showmax":"6"},"extension":{"layout":"3,3,3,3","showall":"0","showmax":"6"},"bottom":{"layout":"3,3,3,3","showall":"0","showmax":"6"},"footer":{"layout":"3,3,3,3","showall":"0","showmax":"6"},"layout-mode":"responsive","loadtransition":"0","component-enabled":"1","mainbody-enabled":"1","rtl-enabled":"1","pagesuffix-enabled":"0","selectivizr-enabled":"0","less":{"compression":"1","compilewait":"2","debugheader":"0"},"ie7splash-enabled":"1","k2":"1"}
User avatar
YankeeDoodle
New php-forum User
New php-forum User
 
Posts: 1
Joined: Tue May 20, 2014 3:52 am
Location: Amsterdam

Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.