# Php/mysql - If table is empty echo" "; else

**URL:** <https://forum.kirupa.com/t/php-mysql-if-table-is-empty-echo-else/134721>\
**Category:** Uncategorized\
**Created:** [January 20, 2005, 10:09pm UTC](https://forum.kirupa.com/t/php-mysql-if-table-is-empty-echo-else/134721 "2005-01-20T22:09:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaykills](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kaykills/32/228_2.png) [@kaykills](https://forum.kirupa.com/u/kaykills)\
**Post date:** [January 20, 2005, 10:09pm UTC](https://forum.kirupa.com/t/php-mysql-if-table-is-empty-echo-else/134721/1 "2005-01-20T22:09:26Z")

</div>

Hey,  
This is a simple problem I think. I may have wrong code or something. I need to print something if the table contains no rows. This is what I basically have.

```php
$result = mysql_query( "SELECT * FROM tryouts ORDER BY priority DESC" );

while ($row = mysql_fetch_array($result))
  {
   if($row == 0){
   print "There are no tryouts at the present time.";
   }
  else{
   print"something else"
   }

```

Can someone tell me where I am going wrong. Thanks in advance.
