[php] need to test if sql query was successful