Hi Thanks for your answer.
I have played with the function mysqli_query() to verify the results
There are 4 main Scenarios
Scenario 1
INSERT INTO (column name) VALUE ('value') WHERE something_id = id
id = real id from the database (FOREIGN KEY) ;
mysqli_query() = 1 (true)
mysqli_affected_rows($dbc) = 1 (true)
Scenario 2
INSERT INTO (column name) VALUE ('value') WHERE something_id = id ;
id = fake id (not exist in the databse)
mysqli_query() = 0 (false)
mysqli_affected_rows($dbc) = -1 (false)
Scenario 3
UPDATE TABLE table_name SET column_name = 'value' WHERE something_id = id ;
id = id real id from the database (FOREIGN KEY)
(Changing value in the table)
mysqli_query() = 1 (true)
mysqli_affected_rows($dbc) = 1 (true)
(Don't changing value in the table)
mysqli_query() = 1 (true)
mysqli_affected_rows($dbc) = 0 (false)
Scenario 4
UPDATE TABLE table_name SET column_name = 'value' WHERE something_id = id ;
id = fake id (not exist in the databse)
mysqli_query() = 1 (true)
mysqli_affected_rows($dbc) = 0 (false)
So after all that
my claim is that mysli_query() return true although when the id isn't real, so it is not a good indication since if somehow my id value isn't correct (or any other problem i didn't tested yet) I won't be able to know that and stop the execution of the code after this point.
Sorry about the length and I do understand it's already out of the book scope I just tested the function and thought you may be interested in the results.
if you have solution I'll be glad to hear from you
Thanks ahead
Yuval