Hi....i just hooked my client up with a search engine....it allows to search the table `jobkseekers` for job hunters....errytin works well except 1 tin....i want the result page to come along with an image when its displaying result......i created a 'cand_image.php' page nd it looks like this
<?php require_once('Connections/connJobsearch.php'); ?>
<?php
session_start();
header("Content-type: image/gif");
$cid = $_SESSION['cid'];
@$sql = "SELECT `image` FROM jobseekers WHERE `id` = '$cid'";
@$result = mysql_query($sql);
@$row_result = mysql_fetch_assoc($result);
$image = $row_result['image'];
echo $image;
?>
for instance when there are more than 1 result, i expect it t dislpay pictures for every user it returns but instead it returns only 1 particular image for every user it returns...i.e the user whose 'id' comes 1st...ANY HELP
search engine with image
Moderator: General Moderators
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: search engine with image
Don't understand you 100% to be honest, but, one point is that if your query returns several results then in order to display each one you are going to have to iterate through them using a loop, which doesn't seem to have been implemented yet.
Do you mean that the same image is being displayed every time? At what point is $_SESSION['cid'] being set?instead it returns only 1 particular image for every user it returns...i.e the user whose 'id' comes 1st
Re: search engine with image
Do you mean that the same image is being displayed every time? At what point is $_SESSION['cid'] being set?[/quote]
Yes the same image is displayed for each result....and i set the $_SESSION['id'] after returning mysql_fetch_assoc($result).
Yes the same image is displayed for each result....and i set the $_SESSION['id'] after returning mysql_fetch_assoc($result).