0 レビュー
1 回答
php-注意:未定義の変数:displaydata
<脇>
答えへのリンク
この質問にはすでに回答があります:
わからない
0
レビュー
答え :
解決策:
あなたのfunction.php
public function DisplayData() { try{ $db = getDB(); $displaydata = $db->prepare('SELECT * FROM tasks ORDER BY created ASC'); $displaydata->execute(); while($row = $displaydata->fetch(PDO::FETCH_ASSOC)) { if($row['created'] < date('Y-m-d')) { echo 'TEST'; } } } catch(PDOException $e) { echo '{"error":{"text":'. $e->getMessage() .'}}'; } }
HTMLファイル:
<?php include('php/functions.php'); ?> <!doctype html> <html ng-app> <head> <title>Opgaver</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script> </head> <body> </body> </html> <?php $fun= new Functions(); $fun->DisplayData(); ?>
わからない
同様の質問
私たちのウェブサイトで同様の質問で答えを見つけてください。