我应该在哪里放置图片才能显示,以及应该插入什么代码我的意思是如何放置一些('admin/savephp/images/<?php echo $rows['image']; ?>')
,因为这是放置图像的地方
<?php
include('../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'];
$resulta = $db->prepare("SELECT sum(votes) FROM candidates WHERE posid= :a");
$resulta->bindParam(':a', $dsds);
$resulta->execute();
for($i=0; $rowa = $resulta->fetch(); $i++){
$dsada=$rowa['sum(votes)'];
}
echo '<div style="margin-top: 18px;">';
echo '<strong>'.$row['pos_name'].' '.'</strong><br>';
$results = $db->prepare("SELECT * FROM candidates,users WHERE candidates.idno=users.idno AND posid= :a ORDER BY votes DESC");
$results->bindParam(':a', $dsds);
$results->execute();
for($i=0; $rows = $results->fetch(); $i++){
if($dsds=='Commissoner'){
echo $rows['course'].' '.$rows['name'].' = '.$rows['votes'];
} else {
echo $rows['lastname'].' = '.$rows['votes'];
}
$sdsd=$dsada
?>
<img src="../img/percent.gif"width='<?php echo(100*round($rows['votes']/($sdsd),2)); ?>'height='10'>
<?php
echo(100*round($rows['votes']/($sdsd),2));
?>
%<br>
<?php
}
}
?>
答案 0 :(得分:2)
您可以在需要图像的情况下执行此操作
echo '<img src="admin/savephp/images/'.$rows['image'].'" \>';