Jump to content

[SOLVED] while ?


ccrevcypsys

Recommended Posts

Can you use an else with a while statement because i might have it wrong... I dont know how i could possible have it wrong but i am trying to add a statement that comes up when a search comes up in no results here is the code i have

 


<?php while ($row = mysql_fetch_array($mainquery, MYSQL_ASSOC)){ ?>
<tr>
<td class="soList" width="10%"><a href="serviceOrder.php?p=so&id=<?php echo $row['id']; ?>"><?php echo $row['id']; ?></a></td>
<td class="soList" width="15%"><a href="serviceOrder.php?p=so&id=<?php echo $row['id']; ?>"><?php echo $row['dateCompleted']; ?></a></td>
<td class="soList" width="30%"><a href="serviceOrder.php?p=so&id=<?php echo $row['id']; ?>"><?php echo $row['name']; ?></a></td>
<td class="soList" width="30%"><a href="serviceOrder.php?p=so&id=<?php echo $row['id']; ?>"><?php echo $row['customer_name']; ?></a></td>
<td class="soList" width="15%"><a href="serviceOrder.php?p=so&id=<?php echo $row['id']; ?>"><?php echo $row['status']; ?></a></td>
</tr>
<?php }else{ ?>
<tr><td colspan="6">We Are Sorry But There Where No Matches For What You Are Looking For...</td></tr>
<?php } ?>

Link to comment
https://forums.phpfreaks.com/topic/82543-solved-while/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.