php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40798 Array of mysql_result items not recognized as such
Submitted: 2007-03-14 01:09 UTC Modified: 2007-03-14 01:21 UTC
From: mailme at granville dot nl Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.2.1 OS: WINDOWS XP
Private report: No CVE-ID: None
 [2007-03-14 01:09 UTC] mailme at granville dot nl
Description:
------------
SITUATION: 
I build an array using $array[] = mysql_result($resource, $record, $column);.
Afterwards I want to seek in the array using if (in_array($needle,array)) but I get an error "Warning: in_array() [function.in-array]: Wrong datatype for second argument". If one line higher I test using is_array() I will get true and using print_r() also gives me the array contents.

If I add an extra item to the array using $array[] = 'string'. The error is not given


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-14 01:14 UTC] mailme at granville dot nl
I ACTUALLY ENTERED A SMALL ERROR IN MY SUBMISSION:
Afterwards I want to seek in the array using: if (in_array($needle, $array)) but I get an error "Warning: in_array()
[function.in-array]: Wrong datatype for second argument".
 [2007-03-14 01:21 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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 01:01:30 2024 UTC