Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > SUPPORT / INFORMATION > Pixelpost Help

Post Reply
 
Thread Tools
  #1  
Old 11-14-2004, 12:11 AM
nauz Offline
pending loafer
 
Join Date: Oct 2004
Location: new york
Posts: 51
Send a message via MSN to nauz
Search Function [mission accomplished]

Okay no one responded to my search function request.
Keep in mind i'm not a PHP coder so any input would be helpful.

I copied a goofy script that I edited to search mysql for title names.
look: http://www.nauglevision.com/pix/search.htm search "dog"

What this gives me is printout:

2004-10-22 12:45:39
JJ Doggle
jj_pola.jpg
- - - - - -

2004-10-29 10:48:51
Sitting Dog
IMG_0124.jpg
- - - - - -



okay so it's successfully searching the table i want and returning the results.
Now, how can i make these results hyplerlinked to the image/page?
I know generating a thumbnail in the search result would be rad but that ain't going to happen.

-OR-
Would there be a way to search the RSS / feed file and give me the results as a link?

Again, any input would be great.
Attached is the PHP file i made the search from:

Code:
<?
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("localhost","dodobaseXXX","XXXXX"); 
	
//select which database you want to edit
mysql_select_db("XXXXXXX"); 

$search=$_POST["search"];

//get the mysql and store them in $result
//change whatevertable to the mysql table you're using
//change whatevercolumn to the column in the table you want to search
//$result = mysql_query("SELECT * FROM news WHERE message LIKE '%$search%'");
$result = mysql_query("SELECT * FROM pixelpost_pixelpost WHERE headline LIKE '%$search%'");

//grab all the content
while($r=mysql_fetch_array($result))
{	
   //the format is $variable = $r["nameofmysqlcolumn"];
   //modify these to match your mysql table columns
  
   $datetime=$r["datetime"];
   $headline=$r["headline"];
   $body=$r["body"];
   $image=$r["image"];
   $category=$r["category"];
   $id=$r["id"];
   
   //display the row
     echo "$datetime <br> $headline <br> $image <br>- - - - - -<br>";
}
?>


Here's the result i get:

2004-10-22 12:45:39
JJ Doggle
jj_pola.jpg
- - - - - -

2004-10-29 10:48:51
Sitting Dog <--- i want this linked
IMG_0124.jpg
- - - - - -

Great, but how about a link....or a thumbnail? ohhhhh, fucking wicked!

Thanks Pixel peeps.
-nauz
__________________
www.nauglevision.com/pix
Reply With Quote
  #2  
Old 11-14-2004, 07:46 PM
pixelpunk's Avatar
pixelpunk Offline
pixelpost guru
 
Join Date: Oct 2004
Location: Sweden
Posts: 504
Send a message via ICQ to pixelpunk
Re: Search Function - any PHP coders for advice??

Code:
 //display the row
     echo "$datetime <br> <a href=\"index.php?showimage=$id\">$headline</a> <br> <a href=\"index.php?showimage=$id\"><img src=\"thumbnails/thumb_$image\"></a> <br>- - - - - -<br>";
}
?>
Try that one.
__________________
icq: 66760929
Reply With Quote
  #3  
Old 11-14-2004, 08:00 PM
nauz Offline
pending loafer
 
Join Date: Oct 2004
Location: new york
Posts: 51
Send a message via MSN to nauz
The pixel master solves it again!!

You rock!

I figured you knew the code inside and out.
Thanks again.

-N
__________________
www.nauglevision.com/pix
Reply With Quote
  #4  
Old 11-14-2004, 10:14 PM
nauz Offline
pending loafer
 
Join Date: Oct 2004
Location: new york
Posts: 51
Send a message via MSN to nauz
Works check it out

Yep.

http://www.nauglevision.com/pix/search.htm

javascript:emoticon(':lol:')
__________________
www.nauglevision.com/pix
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 03:47 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs