|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-09-04 19:50 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 06:00:01 2025 UTC |
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'