Jump to content

What am i doing wrong?


Goins

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>

Archived

This topic is now archived and is closed to further replies.

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