PHP 7.0下的PDO FETCH_ASSOC

时间:2018-05-26 06:51:42

标签: php pdo

有谁知道为什么这个脚本在PHP 5.6下工作正常,当我改为PHP 7.0时,它不是?然而,当我这样做时,结果被正确检索

echo $translator->customers_customer_data_field_email;

没有输出。

    $sql = "SELECT name, value FROM ".$tab_translator." WHERE lang_id=:lang_id";
try {
	$fetchTextTranslated = $conn->prepare($sql);
	$fetchTextTranslated->bindValue(':lang_id', (int) $translator_lang_id, PDO::PARAM_INT);
	$fetchTextTranslated->execute();
	}
catch(PDOException $e) {
if ($config->debug==1) { echo 'Error: ' . $e->getMessage(); }// Throw error msg in debug mode
if ($config->debug==1) { $fetchTextTranslated->debugDumpParams(); }

while ($textTranslated = $fetchTextTranslated->fetch(PDO::FETCH_ASSOC)) {
   $translator->$textTranslated['name']=$textTranslated['value'];
}

0 个答案:

没有答案