2016-12-29 72 views
-1

我有這樣一個表:如何選擇具有相同值的錶行?

enter image description here

我要選擇具有相同的代碼行和PHP在我的網頁這樣的例子演示了他們的代碼333306b4af587:

enter image description here

該怎麼做?

+0

你嘗試什麼嗎?發佈有關您的問題的更多細節。 –

+0

歡迎來到SO!不幸的是,它看起來像你的兩個例子都是一樣的。你試過什麼了?爲了幫助我們,請添加一個[最小,完整和可驗證的示例](https://stackoverflow.com/help/mcve) – ti7

+0

沒有代碼,沒有幫助。這個問題缺乏很多細節。 –

回答

0
<?php 
include 'db_inc.php'; 
$code=mysqli_query($dbCnn,"select distinct uniqid,questionid from answers")  or die(mysqli_error($dbCnn)); 

echo "<table border='1'> "; 

while($row=mysqli_fetch_array($code)){ 

$result=mysqli_query($dbCnn,"select * from answers where uniqid='$row[uniqid]' and formid=$form")or die(mysqli_error($dbCnn)); 
    echo "<tr>"; 
    while ($responses=mysqli_fetch_array($result)){ 
     echo "<td>$responses[answer]</td>"; 

    } 
echo "</tr>"; 
} 

echo "</table>"; 
0

使用可以使用這個 您將有

SELECT row FROM table WHERE value1= value2; 

如果你想對的兩個相同的值

SELECT row FROM Qustion1, Question2 WHERE value1 <> value2 AND value1 = value2 
相關問題