0
我使用的是this數據庫,我在我的PHP文件中創建了一個表,其中列出了所有這些值。我將我的「主題」值鏈接到應該顯示「描述」的不同文件,但每次單擊「主題」時,我都會從表格中的第一個輸入中獲得描述。無法在PHP中輸入數據庫中的某些值
這是我的顯示錶
<?php
require_once("models/config.php");
if (!securePage($_SERVER['PHP_SELF'])){die();}
require_once("models/header.php");
?>
<?php
ob_start();
include 'organize_meeting.php';
ob_end_clean();
$mysqli = new mysqli("localhost", "root", "", "users");
$curr_user = $loggedInUser->username;
mysql_connect('localhost', 'root', '');
mysql_select_db('users');
$query = "SELECT * FROM uc_messages WHERE `to` = '$curr_user'";
$records = mysql_query($query);
echo "
<body>
<div id='wrapper'>
<div id='top'><div id='logo'></div></div>
<div id='content'>
<h2>My Meetings</h2>
<div id='left-nav'>";
include("left-nav.php");
echo "
</div>
<div id='main'>
</div>
<div id='bottom'></div>
</div>
</body>
</html>";
?>
<table width = "600" border = "1" cellpadding = "1" cellspacing = "1">
<tr>
<th>From</th>
<th>Subject</th>
<th>Beginning of meeting</th>
<th>End of meeting</th>
</tr>
<?php
while($msgs = mysql_fetch_assoc($records)){
echo "<tr>";
echo "<td>".$msgs['from']."</td>";
echo "
<td>
<a href = 'info.php' target = '_blank_'> ".$msgs['subject']." </a>
</td>
</html>";
echo "<td>".$msgs['TimeFrom']."</td>";
echo "<td>".$msgs['TimeTo']."</td>";
echo "<tr>";
}
?>
代碼,這是我的代碼是suppoused顯示描述
<?php
require_once("models/config.php");
if (!securePage($_SERVER['PHP_SELF'])){die();}
require_once("models/header.php");
?>
<?php
ob_start();
include 'organize_meeting.php';
ob_end_clean();
$mysqli = new mysqli("localhost", "root", "", "users");
$curr_user = $loggedInUser->username;
mysql_connect('localhost', 'root', '');
mysql_select_db('users');
$query = "SELECT * FROM uc_messages WHERE `to` = '$curr_user'";
$records = mysql_query($query);
echo "
<body>
<div id='wrapper'>
<div id='top'><div id='logo'></div></div>
<div id='content'>
<h2>About Meeting</h2>
<div id='left-nav'>";
echo "
</div>
<div id='main'>
</div>
<div id='bottom'></div>
</div>
</body>
</html>";
?>
<?php
$msgs = mysql_fetch_assoc($records);
echo "<p>".$msgs['from']."</p>";
echo "<p>".$msgs['description']."</p>";
echo "<p>".$msgs['TimeFrom']."</p>";
echo "<p>".$msgs['TimeTo']."</p>";
?>
我總是從數據庫中獲取同樣的描述,雖然我點擊不同的輸入。
我想獲得一個行,但由於某些原因,我每次都遇到同一行的描述,沒關係我點擊 –
現在有一個嘗試和分享想法... –
你是不傳遞你想在第二個文件中顯示哪個主題的ID。 –