Solarpitch Posted December 30, 2006 Share Posted December 30, 2006 Hey, How do you print a message in place of a query result to say that there were no results found for the search? I have an idea, but whats the most efficient way?Cheers Link to comment https://forums.phpfreaks.com/topic/32317-quick-question-empty-resultset-message-print/ Share on other sites More sharing options...
emehrkay Posted December 30, 2006 Share Posted December 30, 2006 post your code Link to comment https://forums.phpfreaks.com/topic/32317-quick-question-empty-resultset-message-print/#findComment-150033 Share on other sites More sharing options...
fert Posted December 30, 2006 Share Posted December 30, 2006 if(mysql_num_rows($result)==0){ echo "No results found";} Link to comment https://forums.phpfreaks.com/topic/32317-quick-question-empty-resultset-message-print/#findComment-150038 Share on other sites More sharing options...
Solarpitch Posted December 30, 2006 Author Share Posted December 30, 2006 Hi, here's my code...[code]while($row = $result->fetch_assoc()) { if ($bgcolor == "#F7F7F7"){ $bgcolor = "#FFFFFF"; }else{ $bgcolor = "#F7F7F7"; } echo "<tr bgcolor=".$bgcolor." >"; echo "<td id = 'table_style' width = 85><img src='designs/golftrader_test.jpg' style='border: 1px solid rgb(0, 0, 0);' border='0' width='40' /></td>"; echo "<td id = 'table_style' width = 150>" . $row['header'] . "</td>"; echo "<td id = 'table_style' width = 100>" . $row['make'] . "</td>"; echo "<td id = 'table_style' width = 100>" . $row['offwant'] . "</td>"; echo "<td id = 'table_style' width = 70>" . '€' . $row['price'] . "</td>"; echo "<td id = 'table_style' width = 70 style='font-size:10px;'><a href=\"view_ad.php?ad_id=". $row['add_id'] ."\">View Ad</a></td>"; echo "<td id = 'table_style' style='font-size:10px' align='center'<a href='http://localhost/drivers.php?ID=". $row['add_id'] ."'><img src='designs/golftrader_quick_list.gif' border=0 /></td>"; //echo '<input type="submit" name="Submit" value="Login>>" id="menu_textbox">'; echo "</tr >"; }echo "</table >";[/code] Link to comment https://forums.phpfreaks.com/topic/32317-quick-question-empty-resultset-message-print/#findComment-150039 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.