search engine with image

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
lawillas
Forum Newbie
Posts: 9
Joined: Sat Mar 28, 2009 4:17 pm

search engine with image

Post by lawillas »

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
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: search engine with image

Post by greyhoundcode »

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.
instead it returns only 1 particular image for every user it returns...i.e the user whose 'id' comes 1st
Do you mean that the same image is being displayed every time? At what point is $_SESSION['cid'] being set?
lawillas
Forum Newbie
Posts: 9
Joined: Sat Mar 28, 2009 4:17 pm

Re: search engine with image

Post by lawillas »

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).
Post Reply