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

From: Date: Mon, 14 Oct 2002 14:26:20 +0000
Subject: #19900 [Bgs]: Mysql table with field named "exit" exits php-script when doing a if statement!
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-22370@lists.php.net to get a copy of this message
 ID:               19900
 User updated by:  sk@mira.dk
 Reported By:      sk@mira.dk
 Status:           Bogus
 Bug Type:         MySQL related
 Operating System: FreeBSD 4.1
 PHP Version:      4.2.2
 New Comment:

OK - sorry...


Previous Comments:
------------------------------------------------------------------------

[2002-10-14 07:53:42] derick@php.net

Use $row['exit'] (like it is documented).

Derick

------------------------------------------------------------------------

[2002-10-14 07:51:07] jan@php.net

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

------------------------------------------------------------------------

[2002-10-14 07:48:55] sk@mira.dk

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 this bug report at http://bugs.php.net/?id=19900&edit=1



Thread (4 messages)

« previous php.bugs (#22370) next »