Page 1 of 1

if != question

Posted: Fri May 30, 2003 7:24 am
by jarow
Can´t figure out what is wrong with the following...it won´t print out any values.

Code: Select all

<?php
if ($row_rsdetail['syn'] != ""){echo "$row_rsdetail['syn'] <BR>\n"; } 
if ($row_rsdetail['syn1'] != ""){echo "$row_rsdetail['syn1'] <BR>\n"; } 
?>
Many thanks

Posted: Fri May 30, 2003 7:26 am
by []InTeR[]
You can allso use isset() or empty().

Posted: Fri May 30, 2003 7:47 am
by twigletmac
Have you done:

Code: Select all

echo '<pre>';
print_r($row_rsdetail);
echo '</pre>';
to check values?

Mac

Posted: Fri May 30, 2003 7:50 am
by twigletmac
Ah, there is one major problem with your code, you can't do:

Code: Select all

echo "$array['key'] other text";
you can do:

Code: Select all

echo $array['key'].' other text';
or

Code: Select all

echo "$array[key] other text";
or

Code: Select all

echo "{$array['key']} other text";
Mac

Posted: Sun Jun 01, 2003 10:41 am
by jarow
thanks mac...once again your info has helped me alot