Jump to content

Image search engine and display..


MDanz

Recommended Posts

Hello,

 

I just want a brief understanding on how to do this. I have already done the upload image php and it works, they are stored in a mySQL database.  Now how do i apply a search engine and the results(image) are displayed in a table, one image per cell?

 

I want like a table slide show.. say 30 thumbnail images.  I click the next button and the table repopulates with the 2nd page of 30 other thumbnail images... basically like google images.

 

 

Just some help..

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/168359-image-search-engine-and-display/
Share on other sites

You would want to use a while loop to iterate over the images in your query.

 

then you want to probubly learn pagination techniques.

 

the while loop:

 

                    <? 

$sql="SELECT * FROM images WHERE name LIKE...;
$aResult=mysql_query($sql);
$imgCount=mysql_num_rows($aResult);

				while ($t < $imgCount){
				$name=mysql_result($aResult,$t,name);
				$image=mysql_result($aResult,$t,image);
				$desc=mysql_result($aResult,$t,desc);
				$title=mysql_result($aResult,$t,title);
				echo "<table>
                                                                         <tr><td>$title</td></tr>
                                                                         <tr><td>$image</td></tr>
                                                                         <tr><td>$image</td></tr>
                                                                         </table>";
				$t++;				
				}
				?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.