[PHP] Re: All Queries TRUE even when they should be FALSE

2002-09-20 Thread Philip Hallstrom
Could be wrong, but the fact that $result isn't empty doesn't mean there are rows... it would be better to say: if ( !empty($result) ) { echo VALID QUERY; } else { echo INVALID QUERY; } Although you should probably check $result against TRUE and FALSE instead. If you want to know how

[PHP] Re: All Queries TRUE even when they should be FALSE

2002-09-20 Thread B.C. Lance
you should use mysql_num_rows() to check for records returned instead of using mysql_query(). this is because if $query is a valid $sql statement, mysql_query() will always return a resource link. which evaluates to true. so this will work for you: if (mysql_num_rows($result)) echo record