monkeytooth Posted May 12, 2008 Share Posted May 12, 2008 Alright I'm confused, this method has worked for me in the past without failure.. and now i seem to be loosing the top result in the query.. What I have is 3 tester entries in the DB: test1, test2, test3.. now when I query the DB without fail I get test2 and 3 to comeback and show its results. But test1 has been lost so to speak. while ($row = mysql_fetch_array($result1)) { if ($row['news_status'] == 'c22') { $newz_body = substr($row['news_body'], 0, 150) . "<font color=\"#FF9900\">...</font>"; Quote Link to comment https://forums.phpfreaks.com/topic/105334-solved-lost-query-result/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 12, 2008 Share Posted May 12, 2008 Show the code from your query through the while() loop. Quote Link to comment https://forums.phpfreaks.com/topic/105334-solved-lost-query-result/#findComment-539490 Share on other sites More sharing options...
wildteen88 Posted May 12, 2008 Share Posted May 12, 2008 Post more code, include your query too. Quote Link to comment https://forums.phpfreaks.com/topic/105334-solved-lost-query-result/#findComment-539492 Share on other sites More sharing options...
monkeytooth Posted May 12, 2008 Author Share Posted May 12, 2008 $query="SELECT * FROM tolland_news"; $result1=mysql_query($query) or die ("Error in query: $query. " . mysql_error()); $result1a = mysql_fetch_array( $result1 ); $resulta = mysql_num_rows($result1); while ($row = mysql_fetch_array($result1)) { if ($row['news_status'] == 'c22') { $newz_body = substr($row['news_body'], 0, 150) . "<font color=\"#FF9900\">...</font>"; if ($tblclrz == "") { $tblclrz = "#EBEBEB"; } elseif ($tblclrz == "#EBEBEB") { $tblclrz = "#C0C0C0"; } elseif ($tblclrz == "#C0C0C0") { $tblclrz = "#EBEBEB"; } else { $tblclrz = "#FF0000"; } echo "<table border=\"0\" width=\"610\" id=\"table1\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-family: Verdana; font-size: 8pt\">"; echo " <tr>"; echo " <td style=\"font-family: Verdana; font-size: 8pt\" bgcolor=\"" . $tblclrz . "\"><u>"; echo " <b>Posted: </b>" . $row['news_time'] . " / " . $row['news_date'] . "</u></td>"; echo " </tr>"; echo " <tr>"; echo " <td style=\"font-family: Verdana; font-size: 8pt\" bgcolor=\"" . $tblclrz . "\">$newz_body</td>"; echo " </tr>"; echo " <tr>"; echo " <td style=\"font-family: Verdana; font-size: 8pt\" bgcolor=\"" . $tblclrz . "\" align=\"right\" valign=\"top\">"; echo " <a href=\"" . $row['ID'] . "\">Read more..</a></td>"; echo " </tr>"; echo "</table>"; //echo $tblclrz; } } } mysql_close(); Quote Link to comment https://forums.phpfreaks.com/topic/105334-solved-lost-query-result/#findComment-539496 Share on other sites More sharing options...
monkeytooth Posted May 12, 2008 Author Share Posted May 12, 2008 thats it in all its un-glory.. I dunno what I am doing wrong, what I am missing.. so confused.. Quote Link to comment https://forums.phpfreaks.com/topic/105334-solved-lost-query-result/#findComment-539515 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.