Re: String Comparison
| From: | Adrian Ciutureanu | Date: | Wed, 25 Jul 2001 07:34:00 +0000 |
| Subject: | Re: String Comparison | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-59505@lists.php.net to get a copy of this message | ||
Note that using strings without quotes generates a warning that is not
displayed in the default configuration of PHP. The message looks like
"Warning: Use of undefined constant anyString - assumed 'anyString' in
test.php on line 3"
(line 3: echo anyString;)
If you want to see these warnings, set
error_reporting = E_ALL
instead of
error_reporting = E_ALL & ~E_NOTICE
in php.ini
--- "Jason Bell" <jbell@barkingrat.com> wrote
Hello.
I'm trying to compare two strings, and performa function if the are the
same. Easy right? I thought so until I tried it...
$query = "select type from images where id=$id";
$result = mysql_query($query);
$type = mysql_result($result,0,"type");
print $type;
if (image/pjpeg == $type) { print "Type is JPG"; };
returned:
image/pjpeg
Warning: Division by zero in /home/daelic/www/photo/mkthumb.php on line 8
Any idea on why this won't work?
Thanks!
Jason