#41218 [Com]: mysql_query

From: Date: Sat, 28 Apr 2007 07:48:08 +0000
Subject: #41218 [Com]: mysql_query
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-112019@lists.php.net to get a copy of this message
ID: 41218 Comment by: eugene dot pikalov at gmail dot com Reported By: dailu at mail dot ru Status: Open Bug Type: MySQL related Operating System: Windows XP Pro PHP Version: 5.2.1 New Comment: Write result of your script. >>table contain two equal records How you have learned about it? Previous Comments: ------------------------------------------------------------------------ [2007-04-28 06:13:06] dailu at mail dot ru Description: ------------ Table is empty. I insert one record in table. In spite that table contain two equal records, although at output record is single. I used mysql 5.0.20. P.S.: I'm from Russia, sorry for my english.. Reproduce code: --------------- mysql_connect('localhost', 'root', NULL); mysql_select_db('localhost'); echo ' Before:<br/>'; $result = mysql_query('SELECT * FROM documents'); while($array = mysql_fetch_assoc($result)) printf('%d.%d %s<br/>', $array['id'], $array['id_branch'], $array['name']); // Table is empty mysql_query("INSERT INTO documents (id,id_branch,name) VALUES (NULL, 1, 'Record2')"); echo ' After:<br/>'; $result = mysql_query('SELECT * FROM documents'); while($array = mysql_fetch_assoc($result)) printf('%d.%d %s<br/>', $array['id'], $array['id_branch'], $array['name']); Expected result: ---------------- Before: After: 1.1 Record2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41218&edit=1

« previous php.bugs (#112019) next »