I have a table with columns
id,name,phone,describe
While fetching the values from this table i am using
$row=mysql_fetch_array($query)
Now i want to check whether
$row['describe']
is returning empty value. How to check in php??
I have a table with columns
id,name,phone,describe
While fetching the values from this table i am using
$row=mysql_fetch_array($query)
Now i want to check whether
$row['describe']
is returning empty value. How to check in php??
You can use ==0
, this will check if it equals to 0:
if ($row['describe']==0) { /* code to do */ }
Or empty()
, this will check if it is empty:
if (empty($row['describe'])) { /* code to do */ }
Personally, I would prefer !empty()
as this will check if the variable is empty.
Hope this helps, thanks!