0
我已经在PHP使USER_ID等于用户名
// Get all the questions
$query = mysqli_query($con, "SELECT * FROM da_questions INNER JOIN da_users ORDER BY da_questions.question_id DESC");
$allquestions = array();
while($row = mysqli_fetch_array($query))
{
$allquestions[] = $row;
}
下面的代码我怎样才能使table da_questions
的user_id
等于在da_users
的user_id
所以当我我得到了正确的用户名的执行下列操作正确的用户ID。
<?php foreach($allquestions as $question): ?>
<span><b><?php echo $question['question_title']; ?><span class="pull-right"><?php echo $question['username']; ?></span></b></span>
<hr style="margin-top:0px;" />
<p><?php echo $question['question_text']; ?></p>
<?php endforeach; ?>
所有我能想到当我看到你的查询是“Daaaa熊。” – Jessica