Forum Moderators: coopster

Message Too Old, No Replies

Problem with NULL values

         

dbarasuk

9:35 pm on May 23, 2008 (gmt 0)

10+ Year Member



Hi,
To display the details of a record from Mysql, I run the following query:$sql = "SELECT details FROM expenses WHERE expense_id = '$expense_id'";

Assuming there is no error in this query (which is the case) I am displaying the details of a record whose link is clicked.

If indeed the record has some details in a MySQL column , i display it like:

if(isset($row) )
{
echo $row['details'];
}

This is done successfully

However, if the record whose link is being clicked has no details in the same column, I display it like:

else
{
echo 'Sorry, there are no details for that record'.'<br>';
}

In this later case I am not seeing the string defined in the previous line of code.

How can I work around that problem?

Note: If the record has no details, MySQL displays: "Empty Set(0.13 sec)" as usually known from mysql.

dbarasuk

2:16 pm on May 24, 2008 (gmt 0)

10+ Year Member



problem is solved!