Re: CONTINUE - variable problem - help!
| From: | Stefan Rusterholz | Date: | Wed, 16 Jan 2002 12:54:09 +0000 |
| Subject: | Re: CONTINUE - variable problem - help! | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80687@lists.php.net to get a copy of this message | ||
> hi again!
>
> I tried it but it desn't give me any result back.
> It dosn't print any error message but it desn't print my result either.
>
> this is how I place the code:
>
>
> echo "...some html code...";
> $row["somename_$var"];
> echo "...the continuation of the html code";
>
> thanks!
I think this indice in $row is empty then...
try
echo (isset($row["somename_$var"] && $row["somename_$var"] !==
"") ?
$row["somename_$var"] : "Sorry, but \$row[\"somename_$var\"] is not
set.");
I'll explain, what this code does:
it first checks isset($var) - if this variable (or in this case the indice
of the array) exists, this is true. so if $row["somename_$var"] exists and
is not empty, it does 'echo' the stuff behind the ?, else it does 'echo' the
stuff behind the :
and please don't set your priority to important on the list - thank you.
best regars
Stefan Rusterholz