RE: [PHP] How come this will echo No or nothing?

2002-07-14 Thread César Aracena

I've come up with this before and solved it like this (guess it'll
work):

if($row['plevel'] == '0'){
echo 'No';
} else if($row['plevel'] != '0'){
echo 'Yes';
}

Notice the *ELSE IF* instead of a simple else statement. Try it.

C.

 -Original Message-
 From: JJ Harrison [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, July 13, 2002 1:01 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] How come this will echo No or nothing?
 
 here is the portion of the script:
 
   if($row['plevel'] == '0'){
   echo 'No';
   } else {
   echo 'Yes';
   }
 
 here is my table structure dump:
 
 #
 # Table structure for table `docs`
 #
 
 CREATE TABLE docs (
   id int(11) unsigned NOT NULL auto_increment,
   name varchar(200) NOT NULL default '',
   note varchar(200) NOT NULL default '',
   author varchar(200) NOT NULL default '',
   path varchar(200) NOT NULL default '',
   plevel tinyint(3) NOT NULL default '0',
   type char(3) NOT NULL default '',
   cat tinyint(3) NOT NULL default '0',
   file_size int(11) unsigned NOT NULL default '0',
   date int(11) unsigned NOT NULL default '0',
   PRIMARY KEY  (id)
 ) TYPE=MyISAM;
 
 the row plevel is either 0 or 1.
 
 why won't this script echo Yes?
 
 The reason that the plevel is set in numbers is because I may add
higher
 ones later.
 
 --
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How come this will echo No or nothing?

2002-07-14 Thread Matthew K. Gold

this is from the O'Reilly _Programming PHP_ (Rasmus Lerdorf  Kevin Tatroe):

Because echo is not a true function, you can't use it as part of a larger
expression:

// parse error
if (echo(test)) {
   echo(it worked!;
}

Such errors are easily remedied, though, by using the print() or printf()
functions.

p. 76


Here's how I solved a similar problem:

 if ( $foo != '' ) print ( yes);


and then just add the else statement...

best,

Matt


- Original Message -
From: César Aracena [EMAIL PROTECTED]
To: 'JJ Harrison' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, July 14, 2002 5:42 AM
Subject: RE: [PHP] How come this will echo No or nothing?


 I've come up with this before and solved it like this (guess it'll
 work):

 if($row['plevel'] == '0'){
 echo 'No';
 } else if($row['plevel'] != '0'){
 echo 'Yes';
 }

 Notice the *ELSE IF* instead of a simple else statement. Try it.

 C.

  -Original Message-
  From: JJ Harrison [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, July 13, 2002 1:01 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] How come this will echo No or nothing?
 
  here is the portion of the script:
 
if($row['plevel'] == '0'){
echo 'No';
} else {
echo 'Yes';
}
 
  here is my table structure dump:
 
  #
  # Table structure for table `docs`
  #
 
  CREATE TABLE docs (
id int(11) unsigned NOT NULL auto_increment,
name varchar(200) NOT NULL default '',
note varchar(200) NOT NULL default '',
author varchar(200) NOT NULL default '',
path varchar(200) NOT NULL default '',
plevel tinyint(3) NOT NULL default '0',
type char(3) NOT NULL default '',
cat tinyint(3) NOT NULL default '0',
file_size int(11) unsigned NOT NULL default '0',
date int(11) unsigned NOT NULL default '0',
PRIMARY KEY  (id)
  ) TYPE=MyISAM;
 
  the row plevel is either 0 or 1.
 
  why won't this script echo Yes?
 
  The reason that the plevel is set in numbers is because I may add
 higher
  ones later.
 
  --
  JJ Harrison
  [EMAIL PROTECTED]
  www.tececo.com
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] How come this will echo No or nothing?

2002-07-13 Thread JJ Harrison

here is the portion of the script:

  if($row['plevel'] == '0'){
  echo 'No';
  } else {
  echo 'Yes';
  }

here is my table structure dump:

#
# Table structure for table `docs`
#

CREATE TABLE docs (
  id int(11) unsigned NOT NULL auto_increment,
  name varchar(200) NOT NULL default '',
  note varchar(200) NOT NULL default '',
  author varchar(200) NOT NULL default '',
  path varchar(200) NOT NULL default '',
  plevel tinyint(3) NOT NULL default '0',
  type char(3) NOT NULL default '',
  cat tinyint(3) NOT NULL default '0',
  file_size int(11) unsigned NOT NULL default '0',
  date int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (id)
) TYPE=MyISAM;

the row plevel is either 0 or 1.

why won't this script echo Yes?

The reason that the plevel is set in numbers is because I may add higher
ones later.

--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] How come this will echo No or nothing?

2002-07-13 Thread Cal Evans

because $row['plevel'] is NEVER == '0'  It is probably == 0 though. (note
the missing quotes. ) :)

HTH,
=C=
*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: JJ Harrison [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 11:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How come this will echo No or nothing?


here is the portion of the script:

  if($row['plevel'] == '0'){
  echo 'No';
  } else {
  echo 'Yes';
  }

here is my table structure dump:

#
# Table structure for table `docs`
#

CREATE TABLE docs (
  id int(11) unsigned NOT NULL auto_increment,
  name varchar(200) NOT NULL default '',
  note varchar(200) NOT NULL default '',
  author varchar(200) NOT NULL default '',
  path varchar(200) NOT NULL default '',
  plevel tinyint(3) NOT NULL default '0',
  type char(3) NOT NULL default '',
  cat tinyint(3) NOT NULL default '0',
  file_size int(11) unsigned NOT NULL default '0',
  date int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (id)
) TYPE=MyISAM;

the row plevel is either 0 or 1.

why won't this script echo Yes?

The reason that the plevel is set in numbers is because I may add higher
ones later.

--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How come this will echo No or nothing?

2002-07-13 Thread JJ Harrison

I tried that.

same result.

Here is my (new) snippet:

  if($row['plevel'] == 0){
  echo 'No';
  } else {
  echo 'Yes';
  }

Cal Evans [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 because $row['plevel'] is NEVER == '0'  It is probably == 0 though. (note
 the missing quotes. ) :)

 HTH,
 =C=
 *
 * Cal Evans
 * The Virtual CIO
 * http://www.calevans.com
 *


 -Original Message-
 From: JJ Harrison [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 12, 2002 11:01 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] How come this will echo No or nothing?


 here is the portion of the script:

   if($row['plevel'] == '0'){
   echo 'No';
   } else {
   echo 'Yes';
   }

 here is my table structure dump:

 #
 # Table structure for table `docs`
 #

 CREATE TABLE docs (
   id int(11) unsigned NOT NULL auto_increment,
   name varchar(200) NOT NULL default '',
   note varchar(200) NOT NULL default '',
   author varchar(200) NOT NULL default '',
   path varchar(200) NOT NULL default '',
   plevel tinyint(3) NOT NULL default '0',
   type char(3) NOT NULL default '',
   cat tinyint(3) NOT NULL default '0',
   file_size int(11) unsigned NOT NULL default '0',
   date int(11) unsigned NOT NULL default '0',
   PRIMARY KEY  (id)
 ) TYPE=MyISAM;

 the row plevel is either 0 or 1.

 why won't this script echo Yes?

 The reason that the plevel is set in numbers is because I may add higher
 ones later.

 --
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] How come this will echo No or nothing?

2002-07-13 Thread Cal Evans

Have you done a var_dump on $row to make sure that plevel exists?

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*
 

-Original Message-
From: JJ Harrison [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 11:11 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How come this will echo No or nothing?


I tried that.

same result.

Here is my (new) snippet:

  if($row['plevel'] == 0){
  echo 'No';
  } else {
  echo 'Yes';
  }

Cal Evans [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 because $row['plevel'] is NEVER == '0'  It is probably == 0 though. (note
 the missing quotes. ) :)

 HTH,
 =C=
 *
 * Cal Evans
 * The Virtual CIO
 * http://www.calevans.com
 *


 -Original Message-
 From: JJ Harrison [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 12, 2002 11:01 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] How come this will echo No or nothing?


 here is the portion of the script:

   if($row['plevel'] == '0'){
   echo 'No';
   } else {
   echo 'Yes';
   }

 here is my table structure dump:

 #
 # Table structure for table `docs`
 #

 CREATE TABLE docs (
   id int(11) unsigned NOT NULL auto_increment,
   name varchar(200) NOT NULL default '',
   note varchar(200) NOT NULL default '',
   author varchar(200) NOT NULL default '',
   path varchar(200) NOT NULL default '',
   plevel tinyint(3) NOT NULL default '0',
   type char(3) NOT NULL default '',
   cat tinyint(3) NOT NULL default '0',
   file_size int(11) unsigned NOT NULL default '0',
   date int(11) unsigned NOT NULL default '0',
   PRIMARY KEY  (id)
 ) TYPE=MyISAM;

 the row plevel is either 0 or 1.

 why won't this script echo Yes?

 The reason that the plevel is set in numbers is because I may add higher
 ones later.

 --
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How come this will echo No or nothing?

2002-07-13 Thread JJ Harrison

The value of plevel is 0 according to var_dump.


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

Cal Evans [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Have you done a var_dump on $row to make sure that plevel exists?

 =C=

 *
 * Cal Evans
 * The Virtual CIO
 * http://www.calevans.com
 *


 -Original Message-
 From: JJ Harrison [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 12, 2002 11:11 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] How come this will echo No or nothing?


 I tried that.

 same result.

 Here is my (new) snippet:

   if($row['plevel'] == 0){
   echo 'No';
   } else {
   echo 'Yes';
   }

 Cal Evans [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  because $row['plevel'] is NEVER == '0'  It is probably == 0 though.
(note
  the missing quotes. ) :)
 
  HTH,
  =C=
  *
  * Cal Evans
  * The Virtual CIO
  * http://www.calevans.com
  *
 
 
  -Original Message-
  From: JJ Harrison [mailto:[EMAIL PROTECTED]]
  Sent: Friday, July 12, 2002 11:01 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] How come this will echo No or nothing?
 
 
  here is the portion of the script:
 
if($row['plevel'] == '0'){
echo 'No';
} else {
echo 'Yes';
}
 
  here is my table structure dump:
 
  #
  # Table structure for table `docs`
  #
 
  CREATE TABLE docs (
id int(11) unsigned NOT NULL auto_increment,
name varchar(200) NOT NULL default '',
note varchar(200) NOT NULL default '',
author varchar(200) NOT NULL default '',
path varchar(200) NOT NULL default '',
plevel tinyint(3) NOT NULL default '0',
type char(3) NOT NULL default '',
cat tinyint(3) NOT NULL default '0',
file_size int(11) unsigned NOT NULL default '0',
date int(11) unsigned NOT NULL default '0',
PRIMARY KEY  (id)
  ) TYPE=MyISAM;
 
  the row plevel is either 0 or 1.
 
  why won't this script echo Yes?
 
  The reason that the plevel is set in numbers is because I may add higher
  ones later.
 
  --
  JJ Harrison
  [EMAIL PROTECTED]
  www.tececo.com
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] How come this will echo No or nothing?

2002-07-13 Thread Cal Evans

off the top of my head, I'd suggest :

if(intval($row['plevel']) == 0){

Grasping at straws here but you've moved beyond a simple question into a
debigging process. (Which doesn't work too well for email.)

Sorry I couldn't be of more help.
=C=
*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: JJ Harrison [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 11:26 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How come this will echo No or nothing?


The value of plevel is 0 according to var_dump.


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

Cal Evans [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Have you done a var_dump on $row to make sure that plevel exists?

 =C=

 *
 * Cal Evans
 * The Virtual CIO
 * http://www.calevans.com
 *


 -Original Message-
 From: JJ Harrison [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 12, 2002 11:11 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] How come this will echo No or nothing?


 I tried that.

 same result.

 Here is my (new) snippet:

   if($row['plevel'] == 0){
   echo 'No';
   } else {
   echo 'Yes';
   }

 Cal Evans [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  because $row['plevel'] is NEVER == '0'  It is probably == 0 though.
(note
  the missing quotes. ) :)
 
  HTH,
  =C=
  *
  * Cal Evans
  * The Virtual CIO
  * http://www.calevans.com
  *
 
 
  -Original Message-
  From: JJ Harrison [mailto:[EMAIL PROTECTED]]
  Sent: Friday, July 12, 2002 11:01 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] How come this will echo No or nothing?
 
 
  here is the portion of the script:
 
if($row['plevel'] == '0'){
echo 'No';
} else {
echo 'Yes';
}
 
  here is my table structure dump:
 
  #
  # Table structure for table `docs`
  #
 
  CREATE TABLE docs (
id int(11) unsigned NOT NULL auto_increment,
name varchar(200) NOT NULL default '',
note varchar(200) NOT NULL default '',
author varchar(200) NOT NULL default '',
path varchar(200) NOT NULL default '',
plevel tinyint(3) NOT NULL default '0',
type char(3) NOT NULL default '',
cat tinyint(3) NOT NULL default '0',
file_size int(11) unsigned NOT NULL default '0',
date int(11) unsigned NOT NULL default '0',
PRIMARY KEY  (id)
  ) TYPE=MyISAM;
 
  the row plevel is either 0 or 1.
 
  why won't this script echo Yes?
 
  The reason that the plevel is set in numbers is because I may add higher
  ones later.
 
  --
  JJ Harrison
  [EMAIL PROTECTED]
  www.tececo.com
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How come this will echo No or nothing?

2002-07-13 Thread JJ Harrison

Still doesn't work.

I'll have to think about it.

I may raise all the values in the plevel colomn by one.

It may work then.


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

Cal Evans [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 off the top of my head, I'd suggest :

 if(intval($row['plevel']) == 0){

 Grasping at straws here but you've moved beyond a simple question into a
 debigging process. (Which doesn't work too well for email.)

 Sorry I couldn't be of more help.
 =C=
 *
 * Cal Evans
 * The Virtual CIO
 * http://www.calevans.com
 *


 -Original Message-
 From: JJ Harrison [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 12, 2002 11:26 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] How come this will echo No or nothing?


 The value of plevel is 0 according to var_dump.


 --
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com

 Cal Evans [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Have you done a var_dump on $row to make sure that plevel exists?
 
  =C=
 
  *
  * Cal Evans
  * The Virtual CIO
  * http://www.calevans.com
  *
 
 
  -Original Message-
  From: JJ Harrison [mailto:[EMAIL PROTECTED]]
  Sent: Friday, July 12, 2002 11:11 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] How come this will echo No or nothing?
 
 
  I tried that.
 
  same result.
 
  Here is my (new) snippet:
 
if($row['plevel'] == 0){
echo 'No';
} else {
echo 'Yes';
}
 
  Cal Evans [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   because $row['plevel'] is NEVER == '0'  It is probably == 0 though.
 (note
   the missing quotes. ) :)
  
   HTH,
   =C=
   *
   * Cal Evans
   * The Virtual CIO
   * http://www.calevans.com
   *
  
  
   -Original Message-
   From: JJ Harrison [mailto:[EMAIL PROTECTED]]
   Sent: Friday, July 12, 2002 11:01 PM
   To: [EMAIL PROTECTED]
   Subject: [PHP] How come this will echo No or nothing?
  
  
   here is the portion of the script:
  
 if($row['plevel'] == '0'){
 echo 'No';
 } else {
 echo 'Yes';
 }
  
   here is my table structure dump:
  
   #
   # Table structure for table `docs`
   #
  
   CREATE TABLE docs (
 id int(11) unsigned NOT NULL auto_increment,
 name varchar(200) NOT NULL default '',
 note varchar(200) NOT NULL default '',
 author varchar(200) NOT NULL default '',
 path varchar(200) NOT NULL default '',
 plevel tinyint(3) NOT NULL default '0',
 type char(3) NOT NULL default '',
 cat tinyint(3) NOT NULL default '0',
 file_size int(11) unsigned NOT NULL default '0',
 date int(11) unsigned NOT NULL default '0',
 PRIMARY KEY  (id)
   ) TYPE=MyISAM;
  
   the row plevel is either 0 or 1.
  
   why won't this script echo Yes?
  
   The reason that the plevel is set in numbers is because I may add
higher
   ones later.
  
   --
   JJ Harrison
   [EMAIL PROTECTED]
   www.tececo.com
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How come this will echo No or nothing?

2002-07-13 Thread JJ Harrison

It *still* didn't work.

I will increment all table cells using a single update query to do them all.


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

Jj Harrison [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Still doesn't work.

 I'll have to think about it.

 I may raise all the values in the plevel colomn by one.

 It may work then.


 --
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com

 Cal Evans [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  off the top of my head, I'd suggest :
 
  if(intval($row['plevel']) == 0){
 
  Grasping at straws here but you've moved beyond a simple question into a
  debigging process. (Which doesn't work too well for email.)
 
  Sorry I couldn't be of more help.
  =C=
  *
  * Cal Evans
  * The Virtual CIO
  * http://www.calevans.com
  *
 
 
  -Original Message-
  From: JJ Harrison [mailto:[EMAIL PROTECTED]]
  Sent: Friday, July 12, 2002 11:26 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] How come this will echo No or nothing?
 
 
  The value of plevel is 0 according to var_dump.
 
 
  --
  JJ Harrison
  [EMAIL PROTECTED]
  www.tececo.com
 
  Cal Evans [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Have you done a var_dump on $row to make sure that plevel exists?
  
   =C=
  
   *
   * Cal Evans
   * The Virtual CIO
   * http://www.calevans.com
   *
  
  
   -Original Message-
   From: JJ Harrison [mailto:[EMAIL PROTECTED]]
   Sent: Friday, July 12, 2002 11:11 PM
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP] How come this will echo No or nothing?
  
  
   I tried that.
  
   same result.
  
   Here is my (new) snippet:
  
 if($row['plevel'] == 0){
 echo 'No';
 } else {
 echo 'Yes';
 }
  
   Cal Evans [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
because $row['plevel'] is NEVER == '0'  It is probably == 0 though.
  (note
the missing quotes. ) :)
   
HTH,
=C=
*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*
   
   
-Original Message-
From: JJ Harrison [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 11:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How come this will echo No or nothing?
   
   
here is the portion of the script:
   
  if($row['plevel'] == '0'){
  echo 'No';
  } else {
  echo 'Yes';
  }
   
here is my table structure dump:
   
#
# Table structure for table `docs`
#
   
CREATE TABLE docs (
  id int(11) unsigned NOT NULL auto_increment,
  name varchar(200) NOT NULL default '',
  note varchar(200) NOT NULL default '',
  author varchar(200) NOT NULL default '',
  path varchar(200) NOT NULL default '',
  plevel tinyint(3) NOT NULL default '0',
  type char(3) NOT NULL default '',
  cat tinyint(3) NOT NULL default '0',
  file_size int(11) unsigned NOT NULL default '0',
  date int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (id)
) TYPE=MyISAM;
   
the row plevel is either 0 or 1.
   
why won't this script echo Yes?
   
The reason that the plevel is set in numbers is because I may add
 higher
ones later.
   
--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
   
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How come this will echo No or nothing?

2002-07-13 Thread JJ Harrison

I found figured it out.

I am a n00b BTW.

the snippet was caught inside anouther if statment so it was only displaying
if the file was under a Meg in size!


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

Jj Harrison [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Still doesn't work.

 I'll have to think about it.

 I may raise all the values in the plevel colomn by one.

 It may work then.


 --
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com

 Cal Evans [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  off the top of my head, I'd suggest :
 
  if(intval($row['plevel']) == 0){
 
  Grasping at straws here but you've moved beyond a simple question into a
  debigging process. (Which doesn't work too well for email.)
 
  Sorry I couldn't be of more help.
  =C=
  *
  * Cal Evans
  * The Virtual CIO
  * http://www.calevans.com
  *
 
 
  -Original Message-
  From: JJ Harrison [mailto:[EMAIL PROTECTED]]
  Sent: Friday, July 12, 2002 11:26 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] How come this will echo No or nothing?
 
 
  The value of plevel is 0 according to var_dump.
 
 
  --
  JJ Harrison
  [EMAIL PROTECTED]
  www.tececo.com
 
  Cal Evans [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Have you done a var_dump on $row to make sure that plevel exists?
  
   =C=
  
   *
   * Cal Evans
   * The Virtual CIO
   * http://www.calevans.com
   *
  
  
   -Original Message-
   From: JJ Harrison [mailto:[EMAIL PROTECTED]]
   Sent: Friday, July 12, 2002 11:11 PM
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP] How come this will echo No or nothing?
  
  
   I tried that.
  
   same result.
  
   Here is my (new) snippet:
  
 if($row['plevel'] == 0){
 echo 'No';
 } else {
 echo 'Yes';
 }
  
   Cal Evans [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
because $row['plevel'] is NEVER == '0'  It is probably == 0 though.
  (note
the missing quotes. ) :)
   
HTH,
=C=
*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*
   
   
-Original Message-
From: JJ Harrison [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 11:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How come this will echo No or nothing?
   
   
here is the portion of the script:
   
  if($row['plevel'] == '0'){
  echo 'No';
  } else {
  echo 'Yes';
  }
   
here is my table structure dump:
   
#
# Table structure for table `docs`
#
   
CREATE TABLE docs (
  id int(11) unsigned NOT NULL auto_increment,
  name varchar(200) NOT NULL default '',
  note varchar(200) NOT NULL default '',
  author varchar(200) NOT NULL default '',
  path varchar(200) NOT NULL default '',
  plevel tinyint(3) NOT NULL default '0',
  type char(3) NOT NULL default '',
  cat tinyint(3) NOT NULL default '0',
  file_size int(11) unsigned NOT NULL default '0',
  date int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (id)
) TYPE=MyISAM;
   
the row plevel is either 0 or 1.
   
why won't this script echo Yes?
   
The reason that the plevel is set in numbers is because I may add
 higher
ones later.
   
--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
   
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php