php - If row empty, echo default text, else echo display data -



php - If row empty, echo default text, else echo display data -

i display "not provided" if addition_1 empty in database , if not empty in database display data? i've tried several combination , can't see figure out missing.

<?php if (empty($row[addition_1])) { echo "not provided"; } else { echo $row[addition_1]; } ?>

try adding quotes array key, change:

$row[addition_1]

to

$row['addition_1']

php mysql

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -