#19900 [NEW]: Mysql table with field named "exit" exits php-script when doing a if statement!

From: Date: Mon, 14 Oct 2002 12:48:55 +0000
Subject: #19900 [NEW]: Mysql table with field named "exit" exits php-script when doing a if statement!
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-22362@lists.php.net to get a copy of this message
From: sk@mira.dk Operating system: FreeBSD 4.1 PHP version: 4.2.2 PHP Bug Type: MySQL related Bug description: Mysql table with field named "exit" exits php-script when doing a if statement! Reproduce bug: -------------- -Create a table with a field name "exit". -Run a script like this: <?php mysql_connect(SQL_HOST, SQL_USER, SQL_PASS); mysql_select_db(SQL_DB); echo "still allive"; $result=mysql_query("select * from table"); while ($row=mysql_fetch_array($result)) { if ($row[exit] == "something") { echo "do something"; } else { echo "something else"; } } echo "dead allready"; ?> The problem is, that when you do a if statement on a $row[exit], then the php script is stoped as if you where calling "exit()"; It's only happening in a if statement with a MySQL field called exit. Configure line: --------------- './configure' '--with-mysql=/usr/local/mysql' '--with-xml' '--enable-track-vars' '--with-apache=/usr/ports/distfiles/apache_1.3.19' '--with-gd=/usr/ports/distfiles/gd-2.0.1' '--enable-ftp' '--enable-bcmath' '--with-jpeg-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-png-dir=/usr/local' '--with-zlib-dir=/usr/include' '--with-gettext' '--with-imap=/usr/ports/distfiles/imap-2001a' -- Edit bug report at http://bugs.php.net/?id=19900&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19900&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19900&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19900&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19900&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19900&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19900&r=support Expected behavior: http://bugs.php.net/fix.php?id=19900&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19900&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19900&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19900&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=19900&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=19900&r=dst IIS Stability: http://bugs.php.net/fix.php?id=19900&r=isapi

« previous php.bugs (#22362) next »