Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001072

[PHP] Re: String Comparison From: Adrian Ciutureanu (Adrian.Ciutureanu <email protected>)
Date: 07/25/01

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 <email protected>> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>