php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41218 mysql_query
Submitted: 2007-04-28 06:13 UTC Modified: 2007-04-28 11:56 UTC
From: dailu at mail dot ru Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.2.1 OS: Windows XP Pro
Private report: No CVE-ID: None
 [2007-04-28 06:13 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-28 07:48 UTC] eugene dot pikalov at gmail dot com
Write result of your script. 

>>table contain two equal records
How you have learned about it?
 [2007-04-28 08:16 UTC] tony2001@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.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 [2007-04-28 11:56 UTC] dailu at mail dot ru
Problem is solve. I'm clean my .htaccess file, source which is:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ /index.php?%{QUERY_STRING} [L]
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:30 2024 UTC