0

My script is stopping (just blank, no error message, though that may be my host's settings - A Small Orange) at this line of code:

call_user_func_array(array($stmt, 'bind_result'), refValues($parameters));

Here are the values going into it:

First Array - that is, array($stmt, 'bind_result')
Array
(
    [0] => mysqli_stmt Object
        (
            [affected_rows] => -1
            [insert_id] => 0
            [num_rows] => 0
            [param_count] => 1
            [field_count] => 4
            [errno] => 0
            [error] => 
            [error_list] => Array
                (
                )

            [sqlstate] => 00000
            [id] => 1
        )

    [1] => bind_result
)

Parameter for Ref Values
Array
(
    [0] => 
    [1] => 
    [2] => 
    [3] => 
)

The odd thing is, it works perfectly well on my local MAMP instance (identical database, basically the same PHP version - MAMP is 5.6.32, A Small Orange is 5.6.35). MAMP's MYSQL is 5.6.38, A Small Orange is 5.5.51-38.2.

The values going into the function are also identical. The MySQLi credentials are valid as the rest of the page has some SELECT queries that work just fine.

Is this an issue with my host or is there something I'm missing? I admit I'm not fluent with MySQLi yet, having grown up on MYSQL and not having time to really get comfortable with the change.


Edit: the newly-shown error code is as follows:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4294967296 bytes) in [REDACTED] on line 171

Now the question is why a relatively simple MYSQL call is using so much memory - it's just selecting a single small row from a tiny little table (256Kib!).

Alex Gold
  • 165
  • 1
  • 9
  • Enable errors so you can see whats going on: https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display – Danny May 26 '18 at 03:18
  • Ah, didn't think of that! I updated the main listing with the error. – Alex Gold May 26 '18 at 03:25

1 Answers1

1

The error came from using mysqli with a longtext column in the database ('templates', in this case). I merely changed that column to mediumtext instead and everything works fine now.

Source:

Allowed memory size of 134217728 bytes exhausted (tried to allocate 4294967296 bytes)

Alex Gold
  • 165
  • 1
  • 9