帮助不知道如何拨打职位名称,我的问题是我的问题,因为当我将其改为像“专员”这样的职位时。它不会起作用但是当我改变它的id它会起作用但是我希望我的代码将是该位置的名称,请求帮助如何将其更改为名称:$dsds
表示id职位
<?php
include ('../connection/connect.php');
$result = $db->prepare("SELECT * FROM candposition ORDER BY posid ASC");
$result->bindParam(':userid', $res);
$result->execute();
for ($i = 0; $row = $result->fetch(); $i++) {
$dsds = $row['posid'];
for ($i = 0; $rows = $results->fetch(); $i++) {
if ($dsds == '9012') {
$result = $db->prepare("SELECT * FROM program ORDER BY progid ASC");
echo $rows['progid'];
echo '<br />';
echo '<div style = "margin-left:2px;display:inline-block;position:relative;">';
echo '<img src="candidates/images/' . $rows['image'] . '" width="90" height="100px" />' . ', ' . '<br />' . $rows['lastname'] . ', ' . $rows['firstname'] . '<br />' . ' = ' . $rows['votes'];
echo '<br />';
}
}
}
答案 0 :(得分:1)
代替:if ($dsds == '9012'){
添加:if ($row[1]== 'Commissioner')