从mysql数组值读取或解析数组数据

时间:2016-02-16 01:56:44

标签: php mysql arrays parsing get

我试图从mysql表中的option_value解析或读取model_name和链接映像到数组func logOutButtonClicked() { 但是没有使用下一个代码,是否有错误?:

$atts['vehicle_models'] as $tab
$query = "SELECT option_value FROM wp_options WHERE option_name='fw_extensions'";
$result = mysql_query($query);

这里是mysql中数组的值,我知道是大的但更多的细节 - 更好:

 $array = array(
        'vehicle_title' => array(
            'label' => __( 'Title', 'fw' ),
            'desc' => __( 'Enter the title . %s for make text normal.  if you dont use %s text will be display bold', 'fw' ),
            'type' => 'text',
            'value' => 'Vehicle Models - Our rental fleet at a glance'
        ),
        'vehicle_models' => array(
            'type' => 'addable-popup',
            'label' => __( 'Vehicle Models', 'fw' ),
            'desc' => __( 'Add Vehicle Models', 'fw' ),
            'template' => '{{=model_name}}',
            'popup-options' => array(
                'model_name' => array(
                    'label' => __( 'Model Name', 'fw' ),
                    'desc' => __( 'Add Vehicle Model Name', 'fw' ),
                    'type' => 'text',
                ),
                'image' => array(
                    'type' => 'upload',
                    'value' => '',
                    'label' => 'Upload image.',
                    'desc' => __( 'Upload model image.  Size 500px 280px', 'fw' ),
                ),
                'rent_rate' => array(
                    'label' => __( 'Rate', 'fw' ),
                    'desc' => __( 'Add rent per day', 'fw' ),
                    'type' => 'text',
                    'value' => '$ 37.40'
                ),
                'perday' => array(
                    'label' => __( 'perday', 'fw' ),
                    'desc' => __( 'Add rent per day', 'fw' ),
                    'type' => 'text',
                    'value' => 'rent per day'
                ),
                'vehicle_details' => array(
                    'type' => 'addable-popup',
                    'label' => __( 'Vehicle Feature', 'fw' ),
                    'desc' => __( 'Add Vehicle Feature', 'fw' ),
                    'template' => '{{=feature}}',
                    'popup-options' => array(

                    'feature' => array(
                        'type' => 'text',
                        'value' => '',
                        'label' => 'feature',
                    ),
                    'feature_details' => array(
                        'label' => __( 'Feature Details', 'fw' ),
                        'desc' => __( 'Feature Details', 'fw' ),
                        'type' => 'text',
                    ),
                ),
            ),
//          'reserve_button' => array(
//              'label' => __( 'Link', 'fw' ),
//              'desc' => __( 'Add rent per day', 'fw' ),
//              'type' => 'text',
//              'value' => '$ 37.40 rent per day'
//          )
        ),
    ),
);


while($row = mysql_fetch_assoc($result)) {
   $array[] = $row;
}

fw_print( $array );
?>

while($row = mysql_fetch_assoc($result)) {
   $array[] = $row;
}

fw_print( $array );
?>

0 个答案:

没有答案