Reputation: 41
Where should I place a the image enable to appear, and what code should be insert I mean how to put some ('admin/savephp/images/<?php echo $rows['image']; ?>')
because this is the place where the image was place
<?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
}
}
?>
Upvotes: 0
Views: 34
Reputation: 382
You can do this whereever you need the image
echo '<img src="admin/savephp/images/'.$rows['image'].'" \>';
Upvotes: 2