frozenpeas
Technical User
Hello.
Here is the page in question:
I am creating links from the database results and this is where my problem is. It seems that no matter what I do, I can generate only one link from the database records.
For the only result displayed, $curRow has a value of 1. However, $totalRows_myQuery has a value of 3.
I suspect it may be the while section of my loop that I am having trouble with.
Thanks everyone.
frozenpeas
Here is the page in question:
I am creating links from the database results and this is where my problem is. It seems that no matter what I do, I can generate only one link from the database records.
Code:
mysql_select_db($database_connect, $connect);
if(!$type){
$type = "web";
}
$query_myQuery = "SELECT * FROM folio WHERE type = '".$type."'";
$myQuery = mysql_query($query_myQuery, $connect) or die("Could not access database. ".mysql_error());
$row_myQuery = mysql_fetch_assoc($myQuery);
$totalRows_myQuery = mysql_num_rows($myQuery);
mysql_free_result($myQuery);
Code:
<?
$curRow = 0;
if($row_myQuery){
do{
$curRow++;
?>
<div id="folioPiece">
<a href="<? echo $_SERVER['PHP_SELF']."?type=".$type."&project=".$row_myQuery['name'];?>"><img src="<? echo $type;?>/images/th_<? echo $row_myQuery['pic'];?>" width="35" height="35" border="0" class="folioThumb" title="<? echo $row_myQuery['name'];?>" /></a><span class="folioThumb"><? echo $row_myQuery['name'];?></span>
<div id="folioCorner"><a href="<? echo $_SERVER['PHP_SELF']."?type=".$type."&project=".$row_myQuery['name'];?>"><img src="../images/foliopiece_corner.gif" border="0" width="14" height="14" title="view project" /></a></div>
</div>
</div>
<? }while($curRow<$totalRows_myQuery);
}
?>
For the only result displayed, $curRow has a value of 1. However, $totalRows_myQuery has a value of 3.
I suspect it may be the while section of my loop that I am having trouble with.
Thanks everyone.
frozenpeas