Jump to content

Recommended Posts

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>";

 

 

Link to comment
https://forums.phpfreaks.com/topic/105334-solved-lost-query-result/
Share on other sites

$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();

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.