priyank Posted May 19, 2009 Share Posted May 19, 2009 Hi, I want to make image gallery with next and previous button and i have to use php and mysql How can i make this. Currently I am displaying all images using following code. But I want to make use of next and previous button and I think it will be more better. mysql_select_db('a3452924_tImages') or die('Could not select database'); // Performing SQL query $query = 'SELECT Image FROM tableImages where imageID = "'.$_GET['dropdown'].'"' ; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); // Printing results in HTML while($row = mysql_fetch_array($result)) { $img = $row['Image']; echo"<img src='$img' />"; } // Free resultset mysql_free_result($result); // Closing connection mysql_close($link); ?> Link to comment https://forums.phpfreaks.com/topic/158733-display-images-with-php-mysql/ Share on other sites More sharing options...
starphp Posted May 19, 2009 Share Posted May 19, 2009 It only requires few lines of code But I don't like to write the code here. Actually, I am using some opensource scripts for doing this. Please make a search on Google or use the following link to get a number of examples: http://www.google.co.in/search?hl=en&rlz=1C1GGLS_enIN323IN323&q=pagination+class+using+php+mysql&btnG=Search&meta=&aq=f&oq= Link to comment https://forums.phpfreaks.com/topic/158733-display-images-with-php-mysql/#findComment-837148 Share on other sites More sharing options...
Ken2k7 Posted May 19, 2009 Share Posted May 19, 2009 Read up on pagination - http://www.phpfreaks.com/tutorial/basic-pagination Link to comment https://forums.phpfreaks.com/topic/158733-display-images-with-php-mysql/#findComment-837223 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.