FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » isset not working with select
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: isset not working with select [message #181422 is a reply to message #181418] Wed, 15 May 2013 21:15 Go to previous message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma:
Senior Member
In article <195lftw1ts4is(dot)1wz8p6f1a44my$(dot)dlg(at)40tude(dot)net>,
richard <noreply(at)example(dot)com> wrote:

> On Mon, 13 May 2013 19:54:53 +0000 (UTC), Denis McMahon wrote:
>
>> On Mon, 13 May 2013 07:01:46 -0400, richard wrote:
>>
>>> What to use to do that?
>>
>> Programming skills and logic.
>>
>> Perhaps you could check that the returned elements contain some viable
>> data after checking if they're set, and if they don't contain such
>> expected viable data, then you could output something else?
>>
>> Given:
>>
>> $cov = mysql_fetch_row($result);
>>
>> Then:
>>
>> if ( isset( $cov[0], $cov[1] ) && is_string( $cov[0] ) && is_string( $cov
>> [1] ) && strlen( $cov[0] ) > 4 && strlen( $cov[1] ) > 4 ) {
>>
>> // here you use $cov[0] and $cov[1] in the output
>>
>> } else {
>>
>> // here you have an alternative output
>>
>> }
>>
>> Now please note carefully:
>>
>> The order of multiple tests in an if statement as shown above can be
>> critical to prevent errors. Don't change it around!
>
> if (isset($cov[0]) && is_string($cov[0]) && strlen(cov[0])>4)
~~~~~~~~
Missing $ sign.

> { echo "<img src='http://mroldies.net/covers/$year/".$cov[0]."'>"; }
>
> Returns a parse error of unexpected '['.
> where did I screw up at?
>
> I want to check both images seperately as I may have one set, but not both.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: mkdir no such file or directory
Next Topic: makes searching and booking applications airfares
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Dec 01 03:26:37 GMT 2024

Total time taken to generate the page: 0.05451 seconds