dietkinnie Posted May 5, 2009 Share Posted May 5, 2009 Hi Everyone, My current slide show uses static data to display images. <div id="feature_gallery"> <div class="bigimg" title="http://farm2.static.flickr.com/1429/1252247669_5f014e7dc1_b.jpg" id="piknown printer took a galley of 1"> <img src="http://farm2.static.flickr.com/1429/1252247669_5f014e7dc1_b.jpg" class="change" ></div> <div class="bigimg" title="http://farm1.static.flickr.com/153/332584527_bd5efc0197_o.jpg" id="picLorem Ipstext of tnpsum hadu typa type spec"> <img src="http://farm1.static.flickr.com/153/332584527_bd5efc0197_o.jpg" class="change" ></div> <div id="output"></div> <a href="http://design-notes.info/tutorial/jquery-tutorial/how-to-creat-a-feature-article-slide-show-with-thumbnails-and-indicator/">Article</a> </div> I now need to insert that data into my db , loop the data an output it in the same syntax ax above , but am not sure how to to do so. Can anyone help me here , or point me in the correct direction ? Thanks in advance !! //DK Quote Link to comment Share on other sites More sharing options...
gnawz Posted May 5, 2009 Share Posted May 5, 2009 Save the data in the database and read it back using variables. have a panel for adding code. Then read it back using loops and variables Quote Link to comment Share on other sites More sharing options...
Axeia Posted May 5, 2009 Share Posted May 5, 2009 If you got mysql available do some reading over at w3schools If you don't have it available, next best thing would probably be includes Quote Link to comment Share on other sites More sharing options...
dietkinnie Posted May 5, 2009 Author Share Posted May 5, 2009 OK i have finally got the code working <?php include '/var/www/html/oddssurf/config.php'; $result = mysql_query("SELECT * FROM SLIDESHOW") or die(mysql_error()); $count = mysql_num_rows($result); //print_r($count); //check count of rows in table while ($row = mysql_fetch_array($result)) { echo "<div class=\"bigimg\" title=\"$row[title]\"id=\"$row[id]\"><img src=\"$row[imgsrc]\" class=\"change\"></div>\n"; } ?> Can anyone tell me if its possible to link the ID to a specific url? The output of the above code is: The output of the above code is <div class="bigimg" title="http://farm2.static.flickr.com/1429/1252247669_5f014e7dc1_b.jpg"id="Hihihihihihihihihihihihih"><img src="http://farm2.static.flickr.com/1429/1252247669_5f014e7dc1_b.jpg" class="change"></div> Now i would like to link "id = "Hihihihihihihihihihihihih" to www.example.com. Is this possible ? Thanks in advance !! Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 5, 2009 Share Posted May 5, 2009 You want to link the entire DIV to that URL? Quote Link to comment Share on other sites More sharing options...
Zhadus Posted May 5, 2009 Share Posted May 5, 2009 You could create a separate table and use "JOIN" within MySQL to use a value for a web address where you would relate the id of "Hihihihihihihihihihihihih" to "www.example.com". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.