Skip to content

possible bug with selecting individual columns vs select splat. #18177

Closed as not planned
@dupes2k

Description

@dupes2k

Description

The following code:

<?php
// If using an SQL statement like:
$sql = "SELECT * FROM"...

// then you can assign array variables just fine as pulled from your $result->fetch_assoc() in your while loop.

// However if your SQL is like:
$sql = "SELECT my_var1 and my_var2 FROM"...

Resulted in this output:

// then using print_r() on the returned structure shows:
//Array
//{
//     [my_var1 and my_var2] => 0
//}

But I expected this output instead:

// normal array structure as shown with print_r()

PHP Version

php ver 8.2.28

Operating System

Debian 12 (bookworm)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions