1

For the life of me, I cannot figure out why I cannot access this data. I am using a mySql query in order to return the id of the last entered record.

SELECT MAX(hca_id) FROM hca

It correctly returns: {'Max(hca_id): 49}

However, I need to set a variable to just use the 49.

If I console.log(result) <-- Returns {0:{MAX(hca_id): 49}

If I console.log(result[0] <-- Returns {MAX(hca_id): 49}

If I console.log(result[0].MAX(hca_id)) <-- Fails to compile: 'hca_id is not defined.

I'm sure it's late and I'm tired and missing something simple. Would appreciate any help though as I've spent too much time on this.

Adam Norton
  • 512
  • 2
  • 5
  • 21

0 Answers0