php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80507 Everything works great if I have this then all the tables if I have more issues
Submitted: 2020-12-12 08:52 UTC Modified: 2020-12-12 23:41 UTC
From: greg-Wilson at shaw dot ca Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 7.4.13 OS: 3.10.0-962.3.2.lve1.5.25.10.el7
Private report: No CVE-ID: None
 [2020-12-12 08:52 UTC] greg-Wilson at shaw dot ca
Description:
------------
If I have 12 database tables are more this is what happens. When I enter a number into the loop, I will always see less database entries then I am supposed to to see. If I run the program 10 times, I would never see same number of entries in the database, totally random.

If I have less than 12 database tables everything works like this post to.



Test script:
---------------
https://www.oerpan.com/mysqli-bug.php

Expected result:
----------------
If I enter 20,000 into loop I expect to see 20,000 database entries.

Actual result:
--------------
When I enter a number into the loop, I will always see a smaller number of database entries then I entered into the loop.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-12 08:57 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2020-12-12 08:57 UTC] requinix@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2020-12-12 21:59 UTC] greg-wilson at shaw dot ca
Yesterday I was testing if I could find a workaround for this issue. Issue occurred when I had 12 or more database tables. Today it's now 11 or more.
 [2020-12-12 22:16 UTC] greg-wilson at shaw dot ca
Here is the database code in SQL

-- phpMyAdmin SQL Dump
-- version 4.9.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 12, 2020 at 05:08 PM
-- Server version: 10.3.23-MariaDB-cll-lve
-- PHP Version: 7.3.6

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `oerpn_members&Data`
--

-- --------------------------------------------------------

--
-- Table structure for table `members`
--

CREATE TABLE `members` (
  `id` mediumint(8) UNSIGNED NOT NULL,
  `username` varchar(20) NOT NULL,
  `firstName` varchar(30) NOT NULL,
  `lastname` varchar(30) NOT NULL,
  `year` smallint(4) UNSIGNED NOT NULL,
  `month` tinyint(2) UNSIGNED NOT NULL,
  `day` tinyint(2) UNSIGNED NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `region2id` smallint(3) UNSIGNED NOT NULL,
  `region2Name` varchar(40) NOT NULL,
  `region3id` tinyint(2) UNSIGNED NOT NULL,
  `region3Name` varchar(40) NOT NULL,
  `color1` tinyint(1) UNSIGNED NOT NULL,
  `color2` tinyint(1) UNSIGNED NOT NULL,
  `color3` tinyint(1) UNSIGNED NOT NULL,
  `color4` tinyint(1) UNSIGNED NOT NULL,
  `color5` tinyint(1) UNSIGNED NOT NULL,
  `color6` tinyint(1) UNSIGNED NOT NULL,
  `color7` tinyint(1) UNSIGNED NOT NULL,
  `color8` tinyint(1) UNSIGNED NOT NULL,
  `color9` tinyint(1) UNSIGNED NOT NULL,
  `color10` tinyint(1) UNSIGNED NOT NULL,
  `entryDate` int(10) UNSIGNED NOT NULL,
  `passwordDate` int(10) UNSIGNED NOT NULL,
  `lastVisit` int(10) UNSIGNED NOT NULL,
  `loginAttemptSuccessFull` varchar(1) NOT NULL,
  `attemptNum` varchar(6) NOT NULL,
  `secretKey` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `members`
--
ALTER TABLE `members`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `members`
--
ALTER TABLE `members`
  MODIFY `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
 [2020-12-12 23:17 UTC] sdsdsdsdsd at dfgfgfgfg dot net
foreach($username as $index => $value)

what about print_r($username)

looking at the codemess i bet this has nothing to do with the database at all
 [2020-12-12 23:41 UTC] requinix@php.net
-Status: Feedback +Status: Open
 [2020-12-12 23:41 UTC] requinix@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.


 [2020-12-12 23:41 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2020-12-12 23:41 UTC] requinix@php.net
.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC