Notice: Undefined offset: 0 in

后端 未结 14 1552
太阳男子
太阳男子 2020-11-28 11:05

I am getting this PHP error, what does it mean?

Notice: Undefined offset: 0 in 
C:\\xampp\\htdocs\\mywebsite\\reddit_vote_tut\\src\\votes.php on line 41


        
相关标签:
14条回答
  • 2020-11-28 11:40

    As explained it happens because there is no data in the $cur_votes[0] and hence it throws an error.

    To ensure your code works fine, before performing "$votes_up = $cur_votes[0]+1;" echo the $cur_votes[0] value to see if there is any value stored or not.

    Surely, there is no value stored.

    0 讨论(0)
  • 2020-11-28 11:45

    If you are using dompdf/dompdf and error occure in vendor/dompdf/dompdf/src/Cellmap.php then It looks like we're using the wrong frame id in the update_row_group method. Initial testing seems to confirm this. Though that may be because this is strictly a paged table issue and not too many of the documents in my test bed have paged tables.

    Can you try changing line 800 to:

    $r_rows = $this->_frames[$g_key]["rows"];
    ($g_key instead of $r_key)

    https://github.com/dompdf/dompdf/issues/1295

    0 讨论(0)
提交回复
热议问题