Notice: Undefined offset: 0 in

后端 未结 14 1611
太阳男子
太阳男子 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:18

    If you leave out the brackets then PHP will assign the keys by default.

    Try this:

    $votes = $row['votes_up']; 
    $votes = $row['votes_down']; 
    

提交回复
热议问题