Jump to content


Photo

Displaying Results


  • This topic is locked This topic is locked
5 replies to this topic

#1 DarkHavn

DarkHavn
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 12 September 2006 - 03:59 AM

Hey, i currently have a search that displays results, but instead of displaying results it displays an image relating to the results, and when they click on the image they go to a page that has some further information.

Now my question is, i have a loop retreiving all the information + images and echoing out the images.

Now i'm stuck as i want to display for images across, and about 5 images downwoods.

example [ ] = an image

[ ] [ ] [ ] [ ] (four images across)
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
(Five images down)

i can put the images inside a div, as the loop is echoing out the information.

How can i go about having it set up like this?

If you need any information please just ask, the script is abit big, but heres the script anyway

if($_POST['submitsearch'] && empty($_POST['search'])){
$error =  "Please enter words for the search";
} else {

connect();
$newkey = $_SESSION['keyword'];


//echo "Searching for $newkey";
$query = "SELECT * FROM catalogue WHERE `keywords` LIKE '%$newkey%'";
   //$query = "SELECT * FROM catalogue WHERE `keywords`='$keyword'";
$result = mysql_query($query);

if(mysql_num_rows($result) >= 1){
$x = 0;
	while($rows = mysql_fetch_assoc($result)){
	$x++;
$values[$x] =  $rows['identifier'];
$pictures[$x] = $rows['images'];
$buisness[$x] = $rows['Buisness'];

$value = ',';
$loc = strpos($value , $pictures[$x]) . ' <Br/>';
$word[$x] = substr(strrchr($pictures[$x], $value), 1);

//$images[x] = $word;
//$word = substr($pictures[$x], $loc);
//echo $word[$x] . "<br/>";



//echo "$dir";

echo "<a href='info.php'><img src='../Clients/$buisness[$x]/images/test.jpg' style='position:relative; float:none; left:460px; z-index:1; top:110px;'><a/> "; 

//echo $values[$x] . " " . $pictures[$x] . " " . $buisness[$x] . "<br/>";
//$_SESSION['access'] = false;
	}
}
}

Please guys im stuck like all hell here

#2 DarkHavn

DarkHavn
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 12 September 2006 - 04:32 AM

please? :( ???

#3 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 12 September 2006 - 04:39 AM

Please don't bump your topic so quickly. Wait 4 to 8 hours. Give people time to look at it, and figure out what you want...

Ken

#4 DarkHavn

DarkHavn
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 12 September 2006 - 05:43 AM

Well since other people can bump there posts and get away with it.

#5 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 12 September 2006 - 06:00 AM

Well since other people can bump there posts and get away with it.


Sure, you post when it's midnight on the east coast of America, and the middle of the night in Europe and then you want to bump your post because nobody answered in half an hour.  Here's a hint ... ever wonder if displaying the results in a table and counting td cells to determine when to start a new row would help?
Legend has it that reading the manual never killed anyone.
My site

#6 DarkHavn

DarkHavn
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 12 September 2006 - 06:20 AM

Cheers for that, apologies for bumping up the post.

Just that everyone else was getting replies and alittle help, and all i was asking was for alittle direction.

Apologies again, will try that idea.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users