Netbeans Xdebug: mysqli_affected_rows returns “-1” when it should be “1”

前端 未结 1 1710
南方客
南方客 2021-01-15 07:31

I\'m puzzled why the following code successfully adds a new row to my database table while mysqli_affected_rows($dbc) returns \"-1\", thus an error, in signup.p

相关标签:
1条回答
  • 2021-01-15 08:12

    I have tested your code and it echos Success when new record inserted to database, please recheck your database to ensure data insertion

    mysqli_affected_rows: return value

        - An integer > 0 indicates the number of rows affected. 
        - 0 indicates that no records where affected &
        -1 indicates that the query returned an error(that may be you case)
    
    0 讨论(0)
提交回复
热议问题