Jump to content

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/107085-what-am-i-doing-wrong/
Share on other sites

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.

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>

         

 

<?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>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.