Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COTried you suggestion with changing $result_array[0], however I'm not getting the error anymore but it's still not updating the field when I use the find_by_id method.
      singulars
    2. COAh, that's a separate problem from before. There are a couple problems I can see. One is that you shouldn't be doing `$sql .= $database->query() ...` etc for all those database methods. Try just doing `$database->query(); $database->bind(); ...$database->execute()` instead. When you do `$sql .= $database->query();", you're actually just appending the return value of those method calls to your `$sql` string - which you don't need to touch anymore since you've already set it as `$database->query()`. But in theory that shouldn't actually prevent the $database object from running its methods.
      singulars
    3. COThe second thing, and this is likely your actual problem, is that when you call the update method, you are trying to change the `id` of the database row you are attempting to update - from `6` to `7`. Look at your update query - it's looking to update a row `WHERE id = ?`. So it's looking for a row with an `id` of `7`, but that row doesn't exist yet. When you update something, you don't want to change the `id`, the DB uses the ID to determine which row to update. If you use a new ID, you are *creating* a new row. So I'd say for now just comment out `$user->id = "7";` and you should be fine.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload