Goins Posted May 24, 2008 Share Posted May 24, 2008 This code displays recent image that i uploaded. It set so it shows 5 Recent Images. But The List Gose Straight Down. I want it to go Straight across. This code is repeated 5 times. <table border="0" cellspacing="0" cellpadding="2" align="center" width="680px"><tr><td align="center"><a href="<a href="<? echo ("$url"); ?>myspace-layouts/viewimage/<?=$res->fields['id']?>"><img src="<? echo ("$url"); ?>userpics/layouts/thumbnail/<?=$res->fields['thumbnail']?>" height="140" width="140" alt="Extreme Graffiti " class="webgames"/></a> <div class="right-links"> <span class="subtitle"><a href="<? echo ("$url"); ?>myspace-layouts/viewimage/<?=$res->fields['id']?>" title="Extreme Graffiti ">Extreme Graffiti </a></span><br/> <span class="clickhere"><a href="<? echo ("$url"); ?>myspace-layouts/preview/<?=$res->fields['id']?>" title="Click to Preview">Preview</a> // <a href="<a href="<? echo ("$url"); ?>myspace-layouts/viewimage/<?=$res->fields['id']?>" title="Click to Get Code">Code</a></span></div></td> Quote Link to comment https://forums.phpfreaks.com/topic/107085-what-am-i-doing-wrong/ Share on other sites More sharing options...
.josh Posted May 24, 2008 Share Posted May 24, 2008 Not 100% but I think that <br/> might have something to do with it. If you practiced better code spacing/indenting it would be 100% easier to find bugs like this... p.s.- If that doesn't fix it, then you're going to have to show more code. Like, the loop. Quote Link to comment https://forums.phpfreaks.com/topic/107085-what-am-i-doing-wrong/#findComment-548974 Share on other sites More sharing options...
Goins Posted May 24, 2008 Author Share Posted May 24, 2008 Hey Sorry. That didn't work. <? $query = "SELECT * FROM layouts ORDER BY id DESC"; $result = mysql_query ($query); $datacheck = mysql_num_rows($result); if ($datacheck == 0) { echo "No data to display!"; } $theCounter = 0; $res = $db->Execute( $query ); while( $theCounter < 4 ){ ?> <table border="0" cellspacing="0" cellpadding="2" align="center" width="680px"><tr><td align="center"><a href="<a href="<? echo ("$url"); ?>myspace-layouts/viewimage/<?=$res->fields['id']?>"><img src="<? echo ("$url"); ?>userpics/layouts/thumbnail/<?=$res->fields['thumbnail']?>" height="140" width="140" alt="Extreme Graffiti " class="webgames"/></a> <div class="right-links"> <span class="subtitle"><a href="<? echo ("$url"); ?>myspace-layouts/viewimage/<?=$res->fields['id']?>" title="Extreme Graffiti ">Extreme Graffiti </a></span><br/> <span class="clickhere"><a href="<? echo ("$url"); ?>myspace-layouts/preview/<?=$res->fields['id']?>" title="Click to Preview">Preview</a> // <a href="<a href="<? echo ("$url"); ?>myspace-layouts/viewimage/<?=$res->fields['id']?>" title="Click to Get Code">Code</a></span></div></td> <br /> <? $theCounter++; $res->MoveNext(); } ?> <div class="left_articles"><div align="right"><a href="<? echo ("$url"); ?>myspace-layouts">All Images >></a></div></td></div> Quote Link to comment https://forums.phpfreaks.com/topic/107085-what-am-i-doing-wrong/#findComment-548986 Share on other sites More sharing options...
.josh Posted May 24, 2008 Share Posted May 24, 2008 hmm, are you sure? because in your new code there, now I see not only one, but two br's.. Quote Link to comment https://forums.phpfreaks.com/topic/107085-what-am-i-doing-wrong/#findComment-548994 Share on other sites More sharing options...
jonsjava Posted May 24, 2008 Share Posted May 24, 2008 <?php /* you're missing a <td> down near the bottom. You need to look over this and make sure that's the intended flow */ $query = "SELECT * FROM layouts ORDER BY id DESC"; $result = mysql_query ($query); $datacheck = mysql_num_rows($result); if ($datacheck == 0) { echo "No data to display!"; } $theCounter = 0; $res = $db->Execute( $query ); while( $theCounter < 4 ){ ?> <table border="0" cellspacing="0" cellpadding="2" align="center" width="680px"> <tr> <td align="center"><a href="<a href="<? echo ("$url"); ?>myspace-layouts/viewimage/<?=$res->fields['id']?>"><img src="<? echo ("$url"); ?>userpics/layouts/thumbnail/<?=$res->fields['thumbnail']?>" height="140" width="140" alt="Extreme Graffiti " class="webgames"/></a> <div class="right-links"> <span class="subtitle"> <a href="<? echo ("$url"); ?>myspace-layouts/viewimage/<?=$res->fields['id']?>" title="Extreme Graffiti ">Extreme Graffiti </a> </span> <br/> <span class="clickhere"> <a href="<? echo ("$url"); ?>myspace-layouts/preview/<?=$res->fields['id']?>" title="Click to Preview">Preview</a> // <a href="<a href="<? echo ("$url"); ?>myspace-layouts/viewimage/<?=$res->fields['id']?>" title="Click to Get Code">Code</a> </span> </div> </td> <br /> <? $theCounter++; $res->MoveNext(); } ?> <div class="left_articles"> <div align="right"><a href="<? echo ("$url"); ?>myspace-layouts">All Images >></a> </div> </td> </div> Quote Link to comment https://forums.phpfreaks.com/topic/107085-what-am-i-doing-wrong/#findComment-548999 Share on other sites More sharing options...
Goins Posted May 24, 2008 Author Share Posted May 24, 2008 Hey Thanks! But it still not working. Its just going straight Down. Quote Link to comment https://forums.phpfreaks.com/topic/107085-what-am-i-doing-wrong/#findComment-549009 Share on other sites More sharing options...
jonsjava Posted May 24, 2008 Share Posted May 24, 2008 My code wasn't a fix, it was to point out your table info is missed up somewhere. Quote Link to comment https://forums.phpfreaks.com/topic/107085-what-am-i-doing-wrong/#findComment-549016 Share on other sites More sharing options...
.josh Posted May 24, 2008 Share Posted May 24, 2008 Also, I don't think you really want your table tag to be inside your loop, do you? And I see no closing tags for tr or for the table. Quote Link to comment https://forums.phpfreaks.com/topic/107085-what-am-i-doing-wrong/#findComment-549018 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.