From:             [EMAIL PROTECTED]
Operating system: FreeBSD 4.3-4.4
PHP version:      4.0.6
PHP Bug Type:     MySQL related
Bug description:  bug when specific html code is on the page

this bug was found using php v4.0.6. it was tested on 2 computers a
FreeBSD4.3 and a FreeBSD4.4 both with php 4.0.6.

The bug is, that with some html code on the page the counter doesn't work
correctly, it count from 2 on 2 and not from 1 on 1.
The bug is caused by the code "<td background="#...>"
More exactly due to the "#". but this code is not between the <? ?> and php
should not be affected.


here is the code for a simple counter:

<HTML>
<table>
  <tr>

        <td background="#000000">

        <?
        mysql_connect("localhost","user","pass");
                mysql_select_db("database");    
                $QUERY = "SELECT visiteurs FROM compteur where id=1";                  
         
                $result = mysql_query($QUERY);
                $val = mysql_fetch_row($result);
                $nb = $val['0'];
                echo"$nb";
                $nb = $nb +1;
                $query2 = "UPDATE compteur set visiteurs = '$nb' where id=1";
                $result2 = mysql_query($query2);
        ?>
        </td>
        </table>
        </html>

the database structure is:

CREATE TABLE compteur (
   id tinyint(4) DEFAULT '0' NOT NULL,
   visiteurs int(11) DEFAULT '0' NOT NULL
);


INSERT INTO compteur VALUES ( '1', '0');

this is my php configure options:

'./configure2' '--with-mysql=../mysql'
'--with-config-file-path=/usr/local/www2/conf' '--with-gd=/usr/local'
'--with-png-dir=/usr/local' '--with-zlib-dir=/usr/local'
'--enable-track-vars' '--enable-ftp' '--with-apxs=/usr/local/www2/bin/apxs'
'--with-jpeg-dir=/usr/local'

and the configure optiosn on the second computer tested:
'./configure' '--with-mysql=/opt1/mysql'
'--with-config-file-path=/opt1/www/conf' '--with-gd=/usr/local'
'--with-png-dir=/usr/local' '--with-zlib-dir=/usr/local'
'--enable-track-vars' '--enable-ftp' '--with-apxs=/opt1/www/bin/apxs'
'--with-jpeg-dir=/usr/local' '--enable-bcmath' '--enable-sockets'
'--with-openssl'
-- 
Edit bug report at: http://bugs.php.net/?id=13128&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to