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

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

How do you set up a perforce server to work over the internet? -

ios - Lagging ScrollView with UIWebview inside -