PHP echo display - Missing first Row from Mysql -
i'm not sure why happening. have read explanations on here can't seem find myself.
on both series , episodes lists site missing first row when echoing results. fix great.
here's coding episode page
<?php include '../connect/dbseries.php' ?> <?php $result2 = mysql_query("select seriesid, seasonindex, sortname, thumbfilename, currentbannerfilename, posterbannerfilename, summary, imdb_id, episodename, episodeindex, compositeid series seriesid = '$_get[id]' order seasonindex, episodeindex asc;"); if (!$result2) { echo 'could not run query: ' . mysql_error(); exit; } $row2 = mysql_fetch_row($result2); //setup array $id = $row2['0']; $seasonindex = $row2['1']; $sortname = $row2['2']; $thumb = $row2['3']; $bannerfilenames = $row2['4']; $currentbanner = $row2['5']; $summary = $row2['6']; $imdb = $row2['7']; $en = $row2['9']; $eid = $row2['9']; $cid = $row2['10']; while($row=mysql_fetch_array($result2)){ echo '<br /> <a href="seriesinfo.php?id='.$row['compositeid'].'"><img src="../images/series/'.$row['thumbfilename'].'" width="200" height="200"></a> "'.$row['summary'].'" "'. $row['episodename'] .'" "'. $row['episodeindex'] .'"' ; } ?>
you missing because of: $row2 = mysql_fetch_row($result2);
mysql_fetch_row moves internal data pointer ahead that's why echoing second record. try echoing before while , problem should fixed.
Comments
Post a Comment