想要将javascript放在php变量中

时间:2018-10-28 15:24:55

标签: javascript php

为什么要拥有这个

  

解析错误:语法错误,意外的“回声”

错误?

<?php
        include("database/connection.php");
        $newtrans= echo "<script>transcript</script>" ;
        try {
            $stmt = $conn->prepare("SELECT d_answer FROM d_brain where d_data=$newtrans"); 
            $stmt->execute();

            // set the resulting array to associative
            $result = $stmt->setFetchMode(PDO::FETCH_ASSOC); 
            foreach(new TableRows(new RecursiveArrayIterator($stmt->fetchAll())) as $k=>$v) { 
                echo $v;
            }
        }
        catch(PDOException $e) {
            echo "Error: " . $e->getMessage();
        }
    ?>

0 个答案:

没有答案