php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22363 2 rows added from mysql_query insert command
Submitted: 2003-02-21 15:05 UTC Modified: 2003-02-27 09:05 UTC
From: georgehubert3 at hotmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.3.1 OS: FreeBSD 4.7-RELEASE #0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: georgehubert3 at hotmail dot com
New email:
PHP Version: OS:

 

 [2003-02-21 15:05 UTC] georgehubert3 at hotmail dot com
Trying to insert data from a posted form into mysql 3.23.42
creates a blank record and then the correct record (2 records total).  Only happens if number of records in table is even (i.e. 2 records, 4 records, etc.).  If number of records in database is odd then the query correctly inserts only one record.  I can reproduce this 100%.  Contact me to see it in action and view scripts.  

$query = "INSERT INTO Ads SET CompanyName = '$CompanyName', WebSite = '$WebSite', Text = '$Text', StartDate = '$StartDate', EndDate = '$EndDate', Notes = '$Notes', Extension = '$Extension'";
$result = mysql_query($query);

Compiled Options:
'./configure' '--with-apxs=/hsphere/shared/apache/bin/apxs' '--with-zip' '--with-bz2' '--with-zlib-dir' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-gd=/hsphere/shared' '--with-mysql=/usr/local' '--with-gettext=/usr/local' '--disable-debug' '--enable-versioning' '--enable-sockets' '--enable-track-vars' '--with-imap=/hsphere/shared' '--with-pgsql=/usr/local' '--enable-ftp' '--localstatedir=/var/hsphere/php' '--enable-trans-sid' '--without-curl' '--with-mcrypt' '--with-dom' 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-21 15:10 UTC] georgehubert3 at hotmail dot com
The Odd/Even info does not happen 100%.  Two rows are always added to the table.
 [2003-02-22 03:46 UTC] georg@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


Could you add a SHORT testcase please, including table definition.
 [2003-02-23 02:16 UTC] sniper@php.net
This has been reported many times and always it has been
broken HTML that causes the page to be loaded twice.

So check this first.

 [2003-02-27 09:04 UTC] georg@php.net
changed status to bogus
 [2003-02-27 09:05 UTC] sniper@php.net
See bug #10599 which explains this.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC