Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

mysql_fetch_field() expects parameter 2 to be

Help
2011-04-10
2013-05-28
  • mysql_fetch_field() expects parameter 2 to be long, string given in C:\xampp\htdocs\refbase-0.9.5\includes\include.inc.php on line 309

     
  • When do you encounter this error?  Have you customized the code at all?  In the codes to getMySQLFieldInfo/mysql_fetch_field, that are obvious, we do pass an integer & not a string.  However, the only  hit for that error is another refbase installation, so something strange may be happening..

     
  • dominic gross
    dominic gross
    2012-01-25

    I recently ran into the same problem after a php update. It turned out to be another symptom of having a too short  suhosin.get.max_value_length setting, i.e. the issue discussed here:
    http://sourceforge.net/projects/refbase/forums/forum/218758/topic/4384615

    IIRC in our installation this warning showed up when:
    1) viewing records (via show.php)
    2) trying to export to bibtex without explicitly selecting that entry  

     

  • Anonymous
    2012-02-25

    so in what file is suhosin.get.max_value_length located?

     
  • php.ini

     
  • ingo
    ingo
    2012-11-01

    I also get this warning on my development installation, when viewing an entry in search.php. Searching itself works fine.
    There are lots of refbase databases online having the same problem (search).
    Anyhow, it doesn't appear on my online copy, so it has to with the server configuration, the database connection or any system user rights?
    Refbase is still working, I can make new entries and can view the old ones.
    I use a clean install with only db.inc.php and ini.inc.php modified.

    Additionally, I get the following notices:
    Notice: Trying to get property of non-object in /Users/path/literatur/includes/include.inc.php on line 312
    Notice: Trying to get property of non-object in /Users/path/literatur/includes/include.inc.php on line 313
    Notice: Trying to get property of non-object in /Users/path/literatur/includes/include.inc.php on line 314
    Notice: Trying to get property of non-object in /Users/path/literatur/includes/include.inc.php on line 315
    Notice: Trying to get property of non-object in /Users/path/literatur/includes/include.inc.php on line 316
    Notice: Trying to get property of non-object in /Users/path/literatur/includes/include.inc.php on line 317
    Notice: Trying to get property of non-object in /Users/path/literatur/includes/include.inc.php on line 318
    Notice: Trying to get property of non-object in /Users/path/literatur/includes/include.inc.php on line 319
    Notice: Trying to get property of non-object in /Users/path/literatur/includes/include.inc.php on line 320
    Notice: Trying to get property of non-object in /Users/path/literatur/includes/include.inc.php on line 321
    Notice: Trying to get property of non-object in /Users/path/literatur/includes/include.inc.php on line 322
    Notice: Trying to get property of non-object in /Users/path/literatur/includes/include.inc.php on line 323
    Notice: Trying to get property of non-object in /Users/path/literatur/includes/include.inc.php on line 324

    My development PHP Version is 5.3.10, MySQL Community Server 5.5.28, running on OS X. Suhosin is also installed, but I followed the above suggestion and even turned it to slmulation-mode (which should turn it off), still the warning is there.

    Any ideas?

     
  • You most likely have something that is modifying your GET query.  You may try changing the form to use POST, which may allow longer queries.  You should also be able to verify Suhosin's status in your logs.