emediastudios Posted March 17, 2008 Share Posted March 17, 2008 I just want the script that draws all my images from my gallery (sql database table name : gallery, 3 fields - ID, title and photo. and places them side by side with there $title below it, I want to build a scrolling gallery that i will place inside a div. when they click the image it will load in a new page. I have this in my admin section but want to edit it so i can use it in my public galley minus the delete option and login requirements. Heres the code i have now. <?php if($secret == "56"){ $items_per_row = "3"; $width_of_thumb = "100"; $height_of_thumb ="100"; $q = "SELECT * FROM gallery"; $r = mysql_query($q) or die(mysql_error()); if(mysql_num_rows($r) > 0) { $content .="<table style='width:100%; height: 100%;'>"; while($result = mysql_fetch_array($r)){ $ctr++; if($ctr == $items_per_row){ $content .= "</tr><tr>"; $ctr=1; } $content .="<td><a href='" .$result[photo]. "'><img src='".$result[photo]."' width='".$width_of_thumb."' height='".$width_of_thumb."'><br><left>".$result[title]."<br><a href='admin.php?p=delete_image&id=".$result[iD]."'>Delete This Image</a></left></a></td>"; } $content .="</table>"; } else $content .= "No Photos Uploaded Yet. <br /><a href=\"admin.php\">Click here to return to admin menu</a>"; } else $content .= "You Must Be Logged In TO Do That. <br /><a href=\"admin.php\">Click here to return to admin menu</a>"; ?> Even if i get a new code and dont use this one be ok. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted March 17, 2008 Share Posted March 17, 2008 and your problem is??? if you have something that works just move it to where you want it and it will still work most likely. 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.