Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #9308

Re: isset not working with select

From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.php
Subject Re: isset not working with select
Date 2013-05-13 19:54 +0000
Organization A noiseless patient Spider
Message-ID <kmrged$mqd$3@dont-email.me> (permalink)
References <zjgov1oukrit$.nu30chb74ox5.dlg@40tude.net>

Show all headers | View raw


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!

-- 
Denis McMahon, denismfmcmahon@gmail.com

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

isset not working with select richard <noreply@example.com> - 2013-05-13 07:01 -0400
  Re: isset not working with select Scott Johnson <noonehome@chalupasworld.com> - 2013-05-13 05:49 -0700
  Re: isset not working with select "Peter H. Coffin" <hellsop@ninehells.com> - 2013-05-13 07:43 -0500
    Re: isset not working with select The Natural Philosopher <tnp@invalid.invalid> - 2013-05-13 23:31 +0100
  Re: isset not working with select "J.O. Aho" <user@example.net> - 2013-05-13 20:10 +0200
    Re: isset not working with select The Natural Philosopher <tnp@invalid.invalid> - 2013-05-13 23:43 +0100
  Re: isset not working with select Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-13 19:54 +0000
    Re: isset not working with select richard <noreply@example.com> - 2013-05-14 17:38 -0400
    Re: isset not working with select richard <noreply@example.com> - 2013-05-15 16:23 -0400
      Re: isset not working with select Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-15 20:34 +0000
        Re: isset not working with select richard <noreply@example.com> - 2013-05-15 17:07 -0400
          Re: isset not working with select Christoph Becker <cmbecker69@gmx.de> - 2013-05-15 23:18 +0200
            Re: isset not working with select richard <noreply@example.com> - 2013-05-15 19:07 -0400
              Syntax Highlighting (was: isset not working with select) Christoph Becker <cmbecker69@gmx.de> - 2013-05-16 01:33 +0200
              Re: isset not working with select Tim Streater <timstreater@greenbee.net> - 2013-05-16 08:27 +0100
        Re: isset not working with select richard <noreply@example.com> - 2013-05-15 17:12 -0400
          Re: isset not working with select Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-15 23:54 +0000
      Re: isset not working with select Tim Streater <timstreater@greenbee.net> - 2013-05-15 22:15 +0100

csiph-web