提取的数据不显示

时间:2018-05-03 07:43:52

标签: php html5

美好的一天, 我有一个.php文件,里面有HTML代码。我试图从我的表中显示获取的数据,并在HTML表格中显示结果。问题是,当我在标签中回显date()函数时,它显示没有问题,但是当我尝试从我的表中显示数据时,它根本没有显示。我检查了我的SQL连接,我没有错误。以下是我的整个页面代码。请帮我。感谢

<html>
<head>
<?php
include("Telegram.php");
include("sqlconfig.php");
include("kayhanexbot.php");
$a = $datatable["transaction_date"];
?>
</head>
<body>
<ul>
  <li>
      Step 1: Transaction Details
  </li>
</ul>
<table id="customers" style="width: 100%">
  <tr><th colspan="2">&nbsp;</th></tr>
  <tr>
    <td style="width: 25%">Date</td>
    <td style="width: 75%"><?php echo $a; ?></td>
  </tr>
  <tr>
    <td style="width: 25%">Rate</td>
    <td style="width: 75%"></td>
  </tr>
  <tr>
    <td style="width: 25%">Amount</td>
    <td style="width: 75%"></td>
  </tr>
  <tr>
    <td style="width: 25%">Reason for Transfer</td>
    <td style="width: 75%"></td>
  </tr>
</table>
<ul>
  <li>
      Step 2: Personal Information in Iran (Sender)
  </li>
</ul>
<table id="customers" style="width: 100%">
  <tr><th colspan="2">&nbsp;</th></tr>
  <tr>
    <td style="width: 25%">First Name</td>
    <td style="width: 75%"></td>
  </tr>
  <tr>
    <td style="width: 25%">Last Name</td>
    <td style="width: 75%"></td>
  </tr>
  <tr>
    <td style="width: 25%">Address (postcode)</td>
    <td style="width: 75%"></td>
  </tr>
  <tr>
    <td style="width: 25%">Mobile Number</td>
    <td style="width: 75%"></td>
  </tr>
  <tr>
    <td style="width: 25%">Email</td>
    <td style="width: 75%"></td>
  </tr>
</table>
<ul>
  <li>
      Step 3: Personal Information in Australia (Receiver)
  </li>
</ul>
<table id="customers" style="width: 100%">
  <tr><th colspan="2">&nbsp;</th></tr>
  <tr>
    <td style="width: 25%">Date</td>
    <td style="width: 75%"></td>
  </tr>
  <tr>
    <td style="width: 25%">Date</td>
    <td style="width: 75%"></td>
  </tr>
  <tr>
    <td style="width: 25%">Date</td>
    <td style="width: 75%"></td>
  </tr>
  <tr>
    <td style="width: 25%">Date</td>
    <td style="width: 75%"></td>
  </tr>
</table>
<ul>
  <li>
      Step 4: Identification
  </li>
</ul>
<table id="customers" style="width: 100%">
  <tr><th colspan="2">Photo ID</th></tr>
  <tr>
    <td colsapn="2"></td>
  </tr>
</table>

</body>
</html>

这是我在&#34; kayhanexbot.php&#34;中的功能:

function GetAllData($db, $chat_id)
{
  $sql = "SELECT a.chat_id,
                b.transaction_date,
                b.transaction_rate,
                b.transaction_amount,
                b.transaction_reason,
                c.transaction_fname,
                c.transaction_lname,
                c.transaction_address,
                c.transaction_mobile,
                c.transaction_email,
                d.bank_acctname,
                d.bank_name,
                d.bank_bsb,
                d.bank_acctnumber,
                d.rcvr_address,
                d.rcvr_email,
                d.rcvr_mobile,
                e.id_image

              FROM UserInfo AS a
              INNER JOIN IrtoAusUser_step1 AS b ON a.chat_id = b.user_id
              INNER JOIN IrtoAusUser_step2 AS c ON a.chat_id = c.user_id
              INNER JOIN IrtoAusUser_step3 AS d ON a.chat_id = d.user_id
              INNER JOIN IrtoAusUser_step4 AS e ON a.chat_id = e.user_id
              WHERE chat_id = '$chat_id'";
              $res = $db->query($sql);
              $row =  $res->fetch_assoc();
              return $row;

}

以下是kayhanexbot.php的上半部分:

<?php
$bot_id = "552964777:AAFu5jtOUZC-Npkmcn71nhDbYeNMz8Z01PM";
$telegram = new Telegram($bot_id);
$text             = $telegram->Text();
$chat_id          = $telegram->ChatID();
$message_id   = $telegram->MessageID();
$name             = $telegram->FirstName();
$family           = $telegram->LastName();
$username         = $telegram->Username();
$callback_data    = $telegram->Callback_Data();
$callback_query   = $telegram->Callback_Query();
$callback_chat_id = $telegram->Callback_ChatID();
$datatext = $telegram->ReplyToMessageID();
$chatid = GetChatInfo($db, $chat_id);
$tDate = GetTDMessage($db, $chat_id);
$datatable = GetAllData($db, $chat_id);
$a = $datatable["transaction_date"];
$b = $datatable["transaction_rate"];
const SITE_URL = 'https://kayhanex.com.au/kayhanexbot/img/';

0 个答案:

没有答案