Only variables can be passed by reference - php

前端 未结 1 1323
挽巷
挽巷 2021-01-27 14:19

i am trying this code, but i get this error:

Only variables can be passed by reference in xxx

script

class page {
  function in         


        
相关标签:
1条回答
  • 2021-01-27 15:22

    I assume you're using mysqli::bind_param. All arguments except the first are passed by reference. This means they must be variables, and not strings, array elements, etc. I'm actually not sure why it needs to do this by reference, but never mind. You can fix it pretty easily:

    $v0 = $v[$i][0];
    $v1 = $v[$i][1];
    $sql->bind_param('ssss', $val, $of, $v0, $v1);
    
    0 讨论(0)
提交回复
热议问题