托管网站上的PHP implode()错误,适用于localhost

时间:2016-09-20 14:44:55

标签: php prestashop implode

我对PrestaShop 1.6.x模块和PHP implode()函数有一个奇怪的问题。在localhost上,我运行查询时没有任何异常。但是,在托管的Web商店中,我得到以下异常:

  

警告:implode():在第183行的../WineSpecifications.php中传递的参数无效

使用implode()的所有行。

此外,来自输入字段的所有数据都会保存在数据库中,刷新之后就会存在。

我的问题是为什么我只在托管网店上收到错误?还有我如何摆脱它?

这是导致问题的查询部分:

      if ($this->existProduct('product_specification_lang', $id_product)) {
        foreach ($languages as $lang) {
            $multiLangQuerry .= 'UPDATE '._DB_PREFIX_."product_specification_lang SET
                region='".pSQL(Tools::getValue('region_'.$lang['id_lang']))."',
                wine_type='".pSQL(Tools::getValue('wine_type_'.$lang['id_lang']))."',
                food_pairings='".pSQL(implode(', ', Tools::getValue('food_pairings_'.$lang['id_lang'])))."',
                tastes='".pSQL(implode(', ', Tools::getValue('tastes_'.$lang['id_lang'])))."',
                scents='".pSQL(implode(', ', Tools::getValue('scents_'.$lang['id_lang'])))."',
                varietal_blend='".pSQL(Tools::getValue('varietal_blend_'.$lang['id_lang']))."',
                composition='".pSQL(Tools::getValue('composition_'.$lang['id_lang']))."',
                vineyard='".pSQL(Tools::getValue('vineyard_'.$lang['id_lang']))."',
                aging_program='".pSQL(Tools::getValue('aging_program_'.$lang['id_lang']))."',
                oak_origin='".pSQL(Tools::getValue('oak_origin_'.$lang['id_lang']))."',
                barrel_toast='".pSQL(Tools::getValue('barrel_toast_'.$lang['id_lang']))."',
                barrel_head_toast='".pSQL(Tools::getValue('barrel_head_toast_'.$lang['id_lang']))."',
                wine_sweetness='".pSQL(Tools::getValue('wine_sweetness_'.$lang['id_lang']))."',
                container_type='".pSQL(Tools::getValue('container_type_'.$lang['id_lang']))."',
                bottle_material='".pSQL(Tools::getValue('bottle_material_'.$lang['id_lang']))."',
                bottle_color='".pSQL(Tools::getValue('bottle_color_'.$lang['id_lang']))."',
                closure_type='".pSQL(Tools::getValue('closure_type_'.$lang['id_lang']))."',
                closure_material='".pSQL(Tools::getValue('closure_material_'.$lang['id_lang']))."',
                special_version='".pSQL(Tools::getValue('special_version_'.$lang['id_lang']))."',
                case_production='".pSQL(Tools::getValue('case_production_'.$lang['id_lang']))."',
                special_features='".pSQL(Tools::getValue('special_features_'.$lang['id_lang']))."',
                winery='".pSQL(Tools::getValue('winery_'.$lang['id_lang']))."',
                winemaker='".pSQL(Tools::getValue('winemaker_'.$lang['id_lang']))."',
                three_word_taste_summary='".pSQL(Tools::getValue('three_word_taste_summary_'.$lang['id_lang']))."',
                tasting_notes='".pSQL(Tools::getValue('tasting_notes_'.$lang['id_lang']))."',
                vintage_notes='".pSQL(Tools::getValue('vintage_notes_'.$lang['id_lang']))."',
        sweet_or_dry='".pSQL(Tools::getValue('sweet_or_dry_'.$lang['id_lang']))."'
                WHERE id_product=".$id_product.' AND id_lang = '.$lang['id_lang'].' ; ';
        }

非常感谢任何帮助!

0 个答案:

没有答案