Bug #79436 [Fbk->Nab]: Declaring Array Index

From: Date: Mon, 30 Mar 2020 22:28:31 +0000
Subject: Bug #79436 [Fbk->Nab]: Declaring Array Index
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226358@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79436&edit=1

 ID:                 79436
 Updated by:         datibbaw@php.net
 Reported by:        schmidtzilla at outlook dot com
 Summary:            Declaring Array Index
-Status:             Feedback
+Status:             Not a bug
 Type:               Bug
 Package:            *General Issues
 Operating System:   LINUX cpanel
 PHP Version:        7.2.29
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php




Previous Comments:
------------------------------------------------------------------------
[2020-03-30 22:26:35] datibbaw@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-03-30 20:02:04] schmidtzilla at outlook dot com

$db->exec("INSERT INTO rounds (type, starts, ends, speed, build, credits, jackpot) VALUES
($round[type], $round[starts], $round[ends], $round[speed], $round[build], $round[credits],
$round[jackpot])");

Gives it a value of 25 because $round[type] is the string 'Speed' which when echoed out
inside my exec without quotes inside of it is now fetching the default value of the databases speed
column which happened to be 25 in the database and it inserted that value into the type column! Very
much expected results! PHP is awesome! :D

------------------------------------------------------------------------
[2020-03-30 19:39:06] schmidtzilla at outlook dot com

You are correct. When I inserted into database I didn't quote the variable and it somehow game
me an unexpected result of 25.

------------------------------------------------------------------------
[2020-03-30 19:26:06] schmidtzilla at outlook dot com

If this is not a bug how would you go about assigning the value 'Speed' into the index
'type' without receiving the indexs value of 25?

------------------------------------------------------------------------
[2020-03-30 19:19:53] 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.

https://3v4l.org/kDjTA

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=79436


--
Edit this bug report at https://bugs.php.net/bug.php?id=79436&edit=1


Thread (1 message)

  • datibbaw@php.net
  • Unknown Message
    • datibbaw@php.net
« previous php.bugs (#226358) next »