hi, I reformatted you code to make it more readable (please use the [php] [/php] tags when you post code)
if ($row = mysql_fetch_array($result)) {
if (stristr('#', $row["name"])) {
print "Check out our new part here";
} else {
print $row["id"];
print(" ");
print $row["name"];
print(" ");
print $row["value"];
print(" ");
print $row["dorder"];
print("<p>");
}
while ($row = mysql_fetch_array($result)) {
;
}
} else {
print "Sorry, no records were found!";
}
now, I can't see what exactly you want to do. I'd guess processing multiple records, diplaying either "Check out our new part here" or the values from the database, and displaying an error message if no rows where selected. If that's correct, here's another approach:
if (mysql_num_rows($result)==0) {
print "Sorry, no records were found!";
}
while ($row = mysql_fetch_array($result)) {
if (stristr('#', $row["name"])) {
print "Check out our new part here";
} else {
print $row["id"];
print(" ");
print $row["name"];
print(" ");
print $row["value"];
print(" ");
print $row["dorder"];
print("<p>");
}
}