Mc Abhel Valerio
Mc Abhel Valerio

Reputation: 41

How should I appear the image in the page?

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'].'&nbsp;'.'</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'].'&nbsp;&nbsp;'.$rows['name'].'&nbsp;&nbsp;=&nbsp;&nbsp;'.$rows['votes'];

    } else {
        echo $rows['lastname'].'&nbsp;&nbsp;=&nbsp;&nbsp;'.$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
    }
    }

?>  

here's the image

Upvotes: 0

Views: 34

Answers (1)

Matriac
Matriac

Reputation: 382

You can do this whereever you need the image

echo '<img src="admin/savephp/images/'.$rows['image'].'" \>';

Upvotes: 2

Related Questions