没有使用php和HTML5从数据库获取数据

时间:2015-10-02 18:51:25

标签: php mysql html5

请原谅我的无知我是一个完全新的PHP和我刚刚在这个网站上注册....我的PHP脚本有问题,我想从数据库中获取每日记录输入的数据,但是当数据显示它显示"没有可显示的数据"请帮忙。这是脚本的代码。

<?php include("db.php") ?>

<?php
$date = 'Date';

$sql2 = "SELECT * FROM ultrasound('ultrasoundNo', 'PatientName', 'ultrasoundScan', 'RefDoctorName', 'gender', 'age', 'amount','report', 'Date')  WHERE Date = $date";

$result = $db -> prepare( $sql2);

$result -> execute();


$outputList = '';



$outputList .= "";
while($row = $result -> fetch( PDO::FETCH_ASSOC )){ 

$outputList .= '<tr class="odd gradeX">';   

$ultrasoundNo = $row["ultrasoundNo"];
$PatientName = $row["PatientName"];
$ultrasoundScan = $row["ultrasoundScan"];
$RefDoctorName = $row["RefDoctorName"];
$gender = $row["gender"];
$age = $row["age"];
$amount = $row["amount"];
$report = $row["report"];
$Date = $row["Date"];



$outputList .= '<td>' . $ultrasoundNo . '</td>' . '<td>' . $PatientName. ' </td>'.
'<td>' . $ultrasoundScan . ' </td>' . '<td>' . $RefDoctorName . ' </td>' . '<td>' . $gender . '</td>' . '<td>' . $age . '</td>' . '<td>' . $amount . '</td>' . '<td>' . $report. '</td>' . '<td>' . $Date . '</td>';

$outputList .= '</tr>';



} // close while loop

0 个答案:

没有答案